This commit is contained in:
swrup 2026-02-27 21:11:23 +01:00
parent 6a44f4a088
commit 18b5bf0726

View file

@ -87,37 +87,38 @@ let keys content =
let* () =
(* TODO O(n^2) *)
v.auditors
|> list_iter
|> List.concat_map
(fun
AuditorKeys.
{ auditor_pub; auditor_url; auditor_name= _; denomination_keys }
->
let auditor_url_hash = Hash.H64.hash auditor_url in
denomination_keys
|> list_iter
|> List.map
(fun AuditorDenominationKey.{ denom_pub_h; auditor_sig } ->
let open Denomination in
let opt =
denom_l |> List.find_opt (fun dn -> dn.h_pub = denom_pub_h)
in
match opt with
| None -> Fmt.error "auditor denomination key not found"
| Some dn ->
let open Signatures.ExchangeKeyValidity in
verify auditor_pub auditor_sig
{
auditor_url_hash;
master= auditor_pub;
start= dn.stamp_start;
expire_withdraw= dn.stamp_expire_withdraw;
expire_spend= dn.stamp_expire_deposit;
expire_legal= dn.stamp_expire_legal;
value= dn.value;
fee_withdraw= dn.fee_withdraw;
fee_deposit= dn.fee_deposit;
fee_refresh= dn.fee_refresh;
denom_hash= denom_pub_h;
}))
(denom_pub_h, auditor_url_hash, auditor_pub, auditor_sig)))
|> list_iter
(fun (denom_pub_h, auditor_url_hash, auditor_pub, auditor_sig) ->
let open Denomination in
denom_l |> List.find_opt (fun dn -> dn.h_pub = denom_pub_h)
|> function
| None -> Fmt.error "auditor denomination key not found"
| Some dn ->
let open Signatures.ExchangeKeyValidity in
verify auditor_pub auditor_sig
{
auditor_url_hash;
master= auditor_pub;
start= dn.stamp_start;
expire_withdraw= dn.stamp_expire_withdraw;
expire_spend= dn.stamp_expire_deposit;
expire_legal= dn.stamp_expire_legal;
value= dn.value;
fee_withdraw= dn.fee_withdraw;
fee_deposit= dn.fee_deposit;
fee_refresh= dn.fee_refresh;
denom_hash= dn.h_pub;
})
in
Ok ()