split binary_types + improve
This commit is contained in:
parent
d2f334f4b1
commit
e3638acde9
6 changed files with 447 additions and 499 deletions
|
|
@ -23,23 +23,19 @@ let mk_future_denom denom_key_signf
|
|||
DenominationKey.Rsa RsaDenominationKey.{ age_mask= 0; rsa_pub= pub }
|
||||
in
|
||||
let denom_secmod_sig =
|
||||
let open Binary_formats in
|
||||
let open Bin_type in
|
||||
let open Bin_signature.DenominationKeyAnnouncementPS in
|
||||
let h_denom_pub = h_pub in
|
||||
let h_section_name = Cstring_hash_64.hash section_name in
|
||||
let anchor_time = TimeAbsoluteNBO.{ v= Util.ptime_to_int64 stamp_start } in
|
||||
let h_section_name = Hash_64_cstr.hash section_name in
|
||||
let _huhu = BlindedCoinHash.hash section_name in
|
||||
let anchor_time = TimeAbsoluteNBO.of_ptime stamp_start in
|
||||
let duration_withdraw =
|
||||
let v =
|
||||
Ptime.diff stamp_start stamp_expire_withdraw
|
||||
|> Util.ptime_of_span_exn
|
||||
|> Util.ptime_to_int64
|
||||
in
|
||||
TimeRelativeNBO.{ v }
|
||||
Ptime.diff stamp_start stamp_expire_withdraw
|
||||
|> Util.ptime_of_span_exn
|
||||
|> TimeRelativeNBO.of_ptime
|
||||
in
|
||||
let ps =
|
||||
DenominationKeyAnnouncementPS.
|
||||
{ h_denom_pub; h_section_name; anchor_time; duration_withdraw }
|
||||
in
|
||||
ps |> Bin.to_string DenominationKeyAnnouncementPS.bin |> denom_key_signf
|
||||
let ps = { h_denom_pub; h_section_name; anchor_time; duration_withdraw } in
|
||||
ps |> Bin.to_string bin |> denom_key_signf
|
||||
in
|
||||
FutureDenom.
|
||||
{
|
||||
|
|
@ -61,19 +57,17 @@ let mk_future_signkey signkey_signf
|
|||
({ pub; stamp_start; stamp_expire; stamp_end; sign= _; master_sig= _ } :
|
||||
Signkey.t) =
|
||||
let signkey_secmod_sig =
|
||||
let open Binary_formats in
|
||||
let open Bin_type in
|
||||
let open Bin_signature.SigningKeyAnnouncementPS in
|
||||
let exchange_pub = pub in
|
||||
let anchor_time = TimeAbsoluteNBO.{ v= Util.ptime_to_int64 stamp_start } in
|
||||
let anchor_time = TimeAbsoluteNBO.of_ptime stamp_start in
|
||||
let duration =
|
||||
let v =
|
||||
Ptime.diff stamp_start stamp_expire
|
||||
|> Util.ptime_of_span_exn
|
||||
|> Util.ptime_to_int64
|
||||
in
|
||||
TimeRelativeNBO.{ v }
|
||||
Ptime.diff stamp_start stamp_expire
|
||||
|> Util.ptime_of_span_exn
|
||||
|> TimeRelativeNBO.of_ptime
|
||||
in
|
||||
let ps = SigningKeyAnnouncementPS.{ exchange_pub; anchor_time; duration } in
|
||||
ps |> Bin.to_string SigningKeyAnnouncementPS.bin |> signkey_signf
|
||||
let ps = { exchange_pub; anchor_time; duration } in
|
||||
ps |> Bin.to_string bin |> signkey_signf
|
||||
in
|
||||
FutureSignKey.
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue