This commit is contained in:
parent
ca3d8824fe
commit
237a137241
1 changed files with 17 additions and 17 deletions
|
|
@ -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 *)
|
||||||
match last_issue_date with
|
let stamp_start_opt =
|
||||||
| None -> denom_l
|
match last_issue_date with
|
||||||
| Some last_issue_date -> (
|
| None -> None
|
||||||
match
|
| Some timestamp ->
|
||||||
List.find_opt
|
List.find_map
|
||||||
(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
|
||||||
| None -> denom_l
|
match stamp_start_opt with
|
||||||
| Some _ ->
|
| None -> denom_l
|
||||||
List.filter
|
| Some timestamp ->
|
||||||
(fun v ->
|
List.filter
|
||||||
Timestamp.compare v.Denomination.stamp_start last_issue_date
|
(fun v -> Timestamp.compare v.Denomination.stamp_start timestamp >= 0)
|
||||||
>= 0)
|
denom_l
|
||||||
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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue