This commit is contained in:
swrup 2026-02-23 09:15:48 +01:00
parent ca3d8824fe
commit 237a137241

View file

@ -73,22 +73,23 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
let denom_l = let denom_l =
(* if `?last_issue_date` query param does not exactly match the `stamp_start` (* if `?last_issue_date` query param does not exactly match the `stamp_start`
of one of the denomination keys, all keys are returned *) of one of the denomination keys, all keys are returned *)
let stamp_start_opt =
match last_issue_date with match last_issue_date with
| None -> denom_l | None -> None
| Some last_issue_date -> ( | Some timestamp ->
match List.find_map
List.find_opt
(fun v -> (fun v ->
Timestamp.compare v.Denomination.stamp_start last_issue_date = 0) if Timestamp.compare v.Denomination.stamp_start timestamp = 0 then
Some v.stamp_start
else None)
denom_l denom_l
with in
match stamp_start_opt with
| None -> denom_l | None -> denom_l
| Some _ -> | Some timestamp ->
List.filter List.filter
(fun v -> (fun v -> Timestamp.compare v.Denomination.stamp_start timestamp >= 0)
Timestamp.compare v.Denomination.stamp_start last_issue_date denom_l
>= 0)
denom_l)
in in
let* denominations = Denomination.make_denom_group denom_l in let* denominations = Denomination.make_denom_group denom_l in
@ -108,9 +109,8 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
| sk :: _ -> sk.SignKey.key | sk :: _ -> sk.SignKey.key
in in
let exchange_sig = let exchange_sig =
(* Compact EdDSA signature (binary-only) over the (* Compact eddsa signature over the contatentation of all of the master_sigs
contatentation of all of the master_sigs (in reverse (in reverse chronological order by group) in the arrays under "denominations" *)
chronological order by group) in the arrays under "denominations". *)
let hc = let hc =
denom_l denom_l
|> List.map (fun dn -> dn.Denomination.master_sig) |> List.map (fun dn -> dn.Denomination.master_sig)