This commit is contained in:
parent
4fd0b41da0
commit
ca413baee7
1 changed files with 8 additions and 16 deletions
|
|
@ -235,7 +235,7 @@ module Purpose = struct
|
||||||
|+ field beint32 (fun t -> t.purpose)
|
|+ field beint32 (fun t -> t.purpose)
|
||||||
|> sealr
|
|> sealr
|
||||||
|
|
||||||
let make size purpose = { size= Int32.of_int size; purpose }
|
let make ~size purpose = { size= Int32.of_int size; purpose }
|
||||||
end
|
end
|
||||||
|
|
||||||
(* This is the running SHA512-hash over all
|
(* 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
|
(* Format used for to generate the signature on a request to withdraw
|
||||||
coins from a reserve. *)
|
coins from a reserve. *)
|
||||||
module Withdraw_request_ps = struct
|
module Withdraw_request_ps = struct
|
||||||
type t = {
|
|
||||||
(* TODO set it in encode/decode *)
|
|
||||||
(* Purpose is #TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
(* Purpose is #TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
||||||
purpose: Purpose.t;
|
type t = {
|
||||||
(* Amount to withdraw, excluding fees, i.e.
|
(* Amount to withdraw, excluding fees, i.e.
|
||||||
the total sum of the denominations of the coins.
|
the total sum of the denominations of the coins.
|
||||||
Note that the reserve must have a value of at least amount+fee. *)
|
Note that the reserve must have a value of at least amount+fee. *)
|
||||||
|
|
@ -419,20 +417,14 @@ module Withdraw_request_ps = struct
|
||||||
+ int32_size
|
+ int32_size
|
||||||
+ Age_mask.size
|
+ Age_mask.size
|
||||||
|
|
||||||
|
let purpose = Purpose.make ~size Taler_signatures.wallet_reserve_withdraw
|
||||||
|
|
||||||
let bin =
|
let bin =
|
||||||
let open Bin in
|
let open Bin in
|
||||||
record
|
record
|
||||||
(fun purpose amount fee h_planchets blinding_seed max_age_group mask ->
|
(fun _purpose amount fee h_planchets blinding_seed max_age_group mask ->
|
||||||
{
|
{ amount; fee; h_planchets; blinding_seed; max_age_group; mask })
|
||||||
purpose;
|
|+ field Purpose.bin (Fun.const purpose)
|
||||||
amount;
|
|
||||||
fee;
|
|
||||||
h_planchets;
|
|
||||||
blinding_seed;
|
|
||||||
max_age_group;
|
|
||||||
mask;
|
|
||||||
})
|
|
||||||
|+ field Purpose.bin (fun t -> t.purpose)
|
|
||||||
|+ field Amount.bin (fun t -> t.amount)
|
|+ field Amount.bin (fun t -> t.amount)
|
||||||
|+ field Amount.bin (fun t -> t.fee)
|
|+ field Amount.bin (fun t -> t.fee)
|
||||||
|+ field Hash_planchets_p.bin (fun t -> t.h_planchets)
|
|+ 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 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 bin =
|
||||||
let open Bin in
|
let open Bin in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue