add hash.ml + refacto
This commit is contained in:
parent
44ddee9dab
commit
34f98b697f
11 changed files with 193 additions and 199 deletions
|
|
@ -1,5 +1,6 @@
|
|||
open Syntax
|
||||
open Api
|
||||
open Hash
|
||||
|
||||
module Keys_get = struct
|
||||
let mk_future_denom (module Sm : Secmod.S) ~section_name
|
||||
|
|
@ -26,7 +27,7 @@ module Keys_get = struct
|
|||
let denom_secmod_sig =
|
||||
let open Bin_sig.DenominationKeyAnnouncement in
|
||||
let h_denom_pub = h_pub in
|
||||
let h_section_name = Bin_type.Hash_64_cstr.hash section_name in
|
||||
let h_section_name = Hash.Cstring.H64.hash section_name in
|
||||
let anchor_time = stamp_start in
|
||||
let duration_withdraw =
|
||||
Timestamp.diff stamp_start stamp_expire_withdraw
|
||||
|
|
@ -293,7 +294,7 @@ module Auditors = struct
|
|||
{
|
||||
start_date= validity_start;
|
||||
auditor_pub;
|
||||
h_auditor_url= Bin_type.Hash_64_cstr.hash auditor_url;
|
||||
h_auditor_url= Hash.Cstring.H64.hash auditor_url;
|
||||
}
|
||||
|
||||
(* TODO timestamps last_change +/- checks *)
|
||||
|
|
@ -389,7 +390,7 @@ module Wire_fee = struct
|
|||
let open Bin_sig.MasterWireFee in
|
||||
verify_f ~f:Sm.verify_with_master_key master_sig_wire
|
||||
{
|
||||
h_wire_method= Bin_type.Hash_64_cstr.hash wire_method;
|
||||
h_wire_method= Hash.Cstring.H64.hash wire_method;
|
||||
start_date= fee_start;
|
||||
end_date= fee_end;
|
||||
wire_fee;
|
||||
|
|
@ -527,15 +528,14 @@ module Wire = struct
|
|||
let conversion_url = "" in
|
||||
let credit_restrictions = "" in
|
||||
let debit_restrictions = "" in
|
||||
let open Bin_type in
|
||||
let* () =
|
||||
let open Bin_sig.MasterWireDetails in
|
||||
verify_f ~f:Sm.verify_with_master_key master_sig_wire
|
||||
{
|
||||
h_wire_details= FullPaytoHash.hash payto_uri;
|
||||
h_conversion_url= Hash_64_cstr.hash conversion_url;
|
||||
h_credit_restrictions= Hash_64_cstr.hash credit_restrictions;
|
||||
h_debit_restrictions= Hash_64_cstr.hash debit_restrictions;
|
||||
h_conversion_url= Hash.Cstring.H64.hash conversion_url;
|
||||
h_credit_restrictions= Hash.Cstring.H64.hash credit_restrictions;
|
||||
h_debit_restrictions= Hash.Cstring.H64.hash debit_restrictions;
|
||||
}
|
||||
in
|
||||
let* () =
|
||||
|
|
@ -544,9 +544,9 @@ module Wire = struct
|
|||
{
|
||||
start_date= validity_start;
|
||||
h_wire= FullPaytoHash.hash payto_uri;
|
||||
h_conversion_url= Hash_64_cstr.hash conversion_url;
|
||||
h_credit_restrictions= Hash_64_cstr.hash credit_restrictions;
|
||||
h_debit_restrictions= Hash_64_cstr.hash debit_restrictions;
|
||||
h_conversion_url= Hash.Cstring.H64.hash conversion_url;
|
||||
h_credit_restrictions= Hash.Cstring.H64.hash credit_restrictions;
|
||||
h_debit_restrictions= Hash.Cstring.H64.hash debit_restrictions;
|
||||
}
|
||||
in
|
||||
Ok ()
|
||||
|
|
@ -596,7 +596,7 @@ module Wire_disable = struct
|
|||
WireTeardownMessage.{ payto_uri; master_sig_del; validity_end } =
|
||||
let open Bin_sig.MasterDelWire in
|
||||
verify_f ~f:Sm.verify_with_master_key master_sig_del
|
||||
{ end_date= validity_end; h_wire= Bin_type.FullPaytoHash.hash payto_uri }
|
||||
{ end_date= validity_end; h_wire= FullPaytoHash.hash payto_uri }
|
||||
|
||||
let do_ ~db_conn
|
||||
WireTeardownMessage.{ payto_uri; master_sig_del= _; validity_end } =
|
||||
|
|
@ -638,13 +638,12 @@ module Drain = struct
|
|||
amount;
|
||||
} =
|
||||
let open Bin_sig.MasterDrainProfit in
|
||||
let open Bin_type in
|
||||
verify_f ~f:Sm.verify_with_master_key master_sig
|
||||
{
|
||||
wtid;
|
||||
date;
|
||||
amount;
|
||||
h_section= Hash_64_cstr.hash debit_account_section;
|
||||
h_section= Hash.Cstring.H64.hash debit_account_section;
|
||||
h_payto= FullPaytoHash.hash credit_payto_uri;
|
||||
}
|
||||
|
||||
|
|
@ -684,7 +683,7 @@ module AmlOfficer = struct
|
|||
{
|
||||
change_date;
|
||||
officer_pub;
|
||||
h_officer_name= Bin_type.Hash_64_cstr.hash officer_name;
|
||||
h_officer_name= Hash.Cstring.H64.hash officer_name;
|
||||
is_active;
|
||||
}
|
||||
|
||||
|
|
@ -727,7 +726,7 @@ module Partners = struct
|
|||
end_date;
|
||||
wad_frequency;
|
||||
wad_fee;
|
||||
h_url= Bin_type.Hash_64_cstr.hash partner_base_url;
|
||||
h_url= Hash.Cstring.H64.hash partner_base_url;
|
||||
}
|
||||
|
||||
let do_ ~db_conn v =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue