This commit is contained in:
swrup 2025-10-07 14:46:39 +02:00
parent 4fd0b41da0
commit ca413baee7

View file

@ -235,7 +235,7 @@ module Purpose = struct
|+ field beint32 (fun t -> t.purpose)
|> sealr
let make size purpose = { size= Int32.of_int size; purpose }
let make ~size purpose = { size= Int32.of_int size; purpose }
end
(* This is the running SHA512-hash over all
@ -367,10 +367,8 @@ module Blinding_master_seed = MK_BASIC_32 ()
(* Format used for to generate the signature on a request to withdraw
coins from a reserve. *)
module Withdraw_request_ps = struct
type t = {
(* TODO set it in encode/decode *)
(* Purpose is #TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
purpose: Purpose.t;
type t = {
(* Amount to withdraw, excluding fees, i.e.
the total sum of the denominations of the coins.
Note that the reserve must have a value of at least amount+fee. *)
@ -419,20 +417,14 @@ module Withdraw_request_ps = struct
+ int32_size
+ Age_mask.size
let purpose = Purpose.make ~size Taler_signatures.wallet_reserve_withdraw
let bin =
let open Bin in
record
(fun purpose amount fee h_planchets blinding_seed max_age_group mask ->
{
purpose;
amount;
fee;
h_planchets;
blinding_seed;
max_age_group;
mask;
})
|+ field Purpose.bin (fun t -> t.purpose)
(fun _purpose amount fee h_planchets blinding_seed max_age_group mask ->
{ amount; fee; h_planchets; blinding_seed; max_age_group; mask })
|+ field Purpose.bin (Fun.const purpose)
|+ field Amount.bin (fun t -> t.amount)
|+ field Amount.bin (fun t -> t.fee)
|+ field Hash_planchets_p.bin (fun t -> t.h_planchets)
@ -462,7 +454,7 @@ module Withdraw_confirmation_ps = struct
}
let size = Purpose.size + Hash_planchets_p.size + int32_size
let purpose = Purpose.make size Taler_signatures.exchange_confirm_withdraw
let purpose = Purpose.make ~size Taler_signatures.exchange_confirm_withdraw
let bin =
let open Bin in