+ wip MasterSignatures
This commit is contained in:
parent
f3de6ea80d
commit
d760a54b61
7 changed files with 136 additions and 68 deletions
|
|
@ -88,3 +88,24 @@ let of_string =
|
|||
(char '.' *> parse_int32)
|
||||
in
|
||||
fun s -> parse_string ~consume:Consume.All parse_t s |> Result.join
|
||||
|
||||
let jsont = Jsont.of_of_string ~kind:"Amount" of_string ~enc:to_string
|
||||
let currency_len = 12
|
||||
|
||||
let bin =
|
||||
let open Bin in
|
||||
record (fun _value _fraction _currency ->
|
||||
(* no need to decode amount? *)
|
||||
assert false)
|
||||
|+ field neint64 (fun t -> t.value)
|
||||
|+ field neint32 (fun t -> t.fraction)
|
||||
|+ field (bytes currency_len) (fun t -> t.currency)
|
||||
|> sealr
|
||||
|
||||
let bin_nbo =
|
||||
let open Bin in
|
||||
record (fun _value _fraction _currency -> assert false)
|
||||
|+ field beint64 (fun t -> t.value)
|
||||
|+ field beint32 (fun t -> t.fraction)
|
||||
|+ field (bytes currency_len) (fun t -> t.currency)
|
||||
|> sealr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue