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 =
(* if `?last_issue_date` query param does not exactly match the `stamp_start`
of one of the denomination keys, all keys are returned *)
let stamp_start_opt =
match last_issue_date with
| None -> denom_l
| Some last_issue_date -> (
match
List.find_opt
| None -> None
| Some timestamp ->
List.find_map
(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
with
in
match stamp_start_opt with
| None -> denom_l
| Some _ ->
| Some timestamp ->
List.filter
(fun v ->
Timestamp.compare v.Denomination.stamp_start last_issue_date
>= 0)
denom_l)
(fun v -> Timestamp.compare v.Denomination.stamp_start timestamp >= 0)
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
in
let exchange_sig =
(* Compact EdDSA signature (binary-only) over the
contatentation of all of the master_sigs (in reverse
chronological order by group) in the arrays under "denominations". *)
(* Compact eddsa signature over the contatentation of all of the master_sigs
(in reverse chronological order by group) in the arrays under "denominations" *)
let hc =
denom_l
|> List.map (fun dn -> dn.Denomination.master_sig)