This commit is contained in:
swrup 2025-10-07 17:28:14 +02:00
parent bc29388ef1
commit 7108ecc797
2 changed files with 18 additions and 10 deletions

View file

@ -451,15 +451,23 @@ module WithdrawConfirmationPS = struct
noreveal_index: int32;
}
let size = Purpose.size + HashPlanchetsP.size + int32_size
let purpose = Purpose.make ~size Taler_signatures.exchange_confirm_withdraw
(*let size = Purpose.size + HashPlanchetsP.size + int32_size*)
open Bin
let bin =
let open Bin in
record (fun _urpose h_planchets noreveal_index ->
{ h_planchets; noreveal_index })
|+ field Purpose.bin (Fun.const purpose)
|+ field HashPlanchetsP.bin (fun t -> t.h_planchets)
|+ field beint32 (fun t -> t.noreveal_index)
record (fun purpose h_planchets noreveal_index ->
(purpose, { h_planchets; noreveal_index }))
|+ field Purpose.bin (fun (purpose, _t) -> purpose)
|+ field HashPlanchetsP.bin (fun (_p, t) -> t.h_planchets)
|+ field beint32 (fun (_p, t) -> t.noreveal_index)
|> sealr
let size =
match Size.of_value (Size.size_of bin) with
| Dynamic _ | Unknown -> Fmt.failwith "size_of failure: size is not Static"
| Static n -> n
let purpose = Purpose.make ~size Taler_signatures.exchange_confirm_withdraw
let bin = map bin (fun (_p, t) -> t) (fun t -> (purpose, t))
end