add timestamp.ml
WIP better time revert this?
This commit is contained in:
parent
d760a54b61
commit
d7d302bafa
10 changed files with 143 additions and 142 deletions
|
|
@ -28,11 +28,9 @@ let mk_future_denom denom_key_signf
|
|||
let open Bin_signature.DenominationKeyAnnouncementPS in
|
||||
let h_denom_pub = h_pub in
|
||||
let h_section_name = Hash_64_cstr.hash section_name in
|
||||
let anchor_time = TimeAbsoluteNBO.of_ptime stamp_start in
|
||||
let anchor_time = stamp_start in
|
||||
let duration_withdraw =
|
||||
Ptime.diff stamp_start stamp_expire_withdraw
|
||||
|> Util.ptime_of_span_exn
|
||||
|> TimeRelativeNBO.of_ptime
|
||||
Timestamp.diff stamp_start stamp_expire_withdraw |> Timestamp.of_span_exn
|
||||
in
|
||||
let ps = { h_denom_pub; h_section_name; anchor_time; duration_withdraw } in
|
||||
ps |> Bin.to_string bin |> denom_key_signf
|
||||
|
|
@ -41,10 +39,10 @@ let mk_future_denom denom_key_signf
|
|||
{
|
||||
section_name;
|
||||
value;
|
||||
stamp_start= Timestamp.of_ptime stamp_start;
|
||||
stamp_expire_withdraw= Timestamp.of_ptime stamp_expire_withdraw;
|
||||
stamp_expire_deposit= Timestamp.of_ptime stamp_expire_deposit;
|
||||
stamp_expire_legal= Timestamp.of_ptime stamp_expire_legal;
|
||||
stamp_start;
|
||||
stamp_expire_withdraw;
|
||||
stamp_expire_deposit;
|
||||
stamp_expire_legal;
|
||||
denom_pub;
|
||||
fee_withdraw;
|
||||
fee_deposit;
|
||||
|
|
@ -57,26 +55,17 @@ let mk_future_signkey signkey_signf
|
|||
({ pub; priv= _; stamp_start; stamp_expire; stamp_end; master_sig= _ } :
|
||||
Signkey.t) =
|
||||
let signkey_secmod_sig =
|
||||
let open Bin_type in
|
||||
let open Bin_signature.SigningKeyAnnouncementPS in
|
||||
let exchange_pub = pub in
|
||||
let anchor_time = TimeAbsoluteNBO.of_ptime stamp_start in
|
||||
let anchor_time = stamp_start in
|
||||
let duration =
|
||||
Ptime.diff stamp_start stamp_expire
|
||||
|> Util.ptime_of_span_exn
|
||||
|> TimeRelativeNBO.of_ptime
|
||||
Timestamp.diff stamp_start stamp_expire |> Timestamp.of_span_exn
|
||||
in
|
||||
let ps = { exchange_pub; anchor_time; duration } in
|
||||
ps |> Bin.to_string bin |> signkey_signf
|
||||
in
|
||||
FutureSignKey.
|
||||
{
|
||||
key= pub;
|
||||
stamp_start= Timestamp.of_ptime stamp_start;
|
||||
stamp_expire= Timestamp.of_ptime stamp_expire;
|
||||
stamp_end= Timestamp.of_ptime stamp_end;
|
||||
signkey_secmod_sig;
|
||||
}
|
||||
{ key= pub; stamp_start; stamp_expire; stamp_end; signkey_secmod_sig }
|
||||
|
||||
let mk_future_keys_response (secmod_signkey : Secmod_signkey.t)
|
||||
(secmod_denom : Secmod_denom.t) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue