This commit is contained in:
parent
2dafed2273
commit
26d4f7b3e5
3 changed files with 9 additions and 20 deletions
|
|
@ -111,13 +111,12 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
|
|||
let wallet_balance_limit_without_kyc = None in
|
||||
let hard_limits = [] in
|
||||
let zero_limits = [] in
|
||||
let dn_l =
|
||||
(*Pg.get_denominations db_conn |> unwrap_err_caqti *)
|
||||
Keys.get_denominations ()
|
||||
|>
|
||||
let* dn_l =
|
||||
let+ l = Pg.get_denominations db_conn |> unwrap_err_caqti in
|
||||
(* reverse chronological order *)
|
||||
List.sort (fun a b ->
|
||||
Stdlib.compare b.Denomination.stamp_start a.stamp_start)
|
||||
List.sort
|
||||
(fun a b -> Stdlib.compare b.Denomination.stamp_start a.stamp_start)
|
||||
l
|
||||
in
|
||||
let list_issue_date =
|
||||
match dn_l with
|
||||
|
|
@ -147,11 +146,10 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
|
|||
List.map denomgroup_of_denomdata l
|
||||
in
|
||||
|
||||
let signkeys =
|
||||
(*
|
||||
let now = Ptime_clock.now () |> Option.some in
|
||||
let+ signkey_data_l = Pg.get_active_signkeys db_conn ~now |> unwrap_err_caqti in*)
|
||||
Keys.get_signkeys ()
|
||||
let* signkeys =
|
||||
let now = Timestamp.of_ptime (Ptime_clock.now ()) in
|
||||
let+ l = Pg.get_active_signkeys db_conn ~now |> unwrap_err_caqti in
|
||||
l
|
||||
|> List.sort (fun a b ->
|
||||
let open Signkey in
|
||||
Stdlib.compare b.stamp_start a.stamp_start)
|
||||
|
|
|
|||
|
|
@ -278,17 +278,12 @@ module Make (Conn : Pg.CONN) = struct
|
|||
| None -> Fmt.failwith "Keys verify_with_signkey failure: not found."
|
||||
| Some _sk -> EddsaSignature.verify ~key:pub s ~msg
|
||||
|
||||
let get_signkeys () = t.sk_ht |> Hashtbl.to_seq_values |> List.of_seq
|
||||
let get_denominations () = t.dn_ht |> Hashtbl.to_seq_values |> List.of_seq
|
||||
|
||||
let get_future_signkeys () =
|
||||
t.future_sk_ht |> Hashtbl.to_seq_values |> List.of_seq
|
||||
|
||||
let get_future_denominations () =
|
||||
t.future_dn_ht |> Hashtbl.to_seq_values |> List.of_seq
|
||||
|
||||
let find_signkey pub = Hashtbl.find_opt t.sk_ht pub
|
||||
let find_denomination h_pub = Hashtbl.find_opt t.dn_ht h_pub
|
||||
let find_future_signkey pub = Hashtbl.find_opt t.future_sk_ht pub
|
||||
let find_future_denomination h_pub = Hashtbl.find_opt t.future_dn_ht h_pub
|
||||
|
||||
|
|
|
|||
|
|
@ -10,12 +10,8 @@ module type S = sig
|
|||
val verify_with_signkey :
|
||||
pub:eddsa_pub -> eddsa_sig -> msg:string -> (unit, string) result
|
||||
|
||||
val get_signkeys : unit -> Signkey.t list
|
||||
val get_denominations : unit -> Denomination.t list
|
||||
val get_future_signkeys : unit -> Api.FutureSignKey.t list
|
||||
val get_future_denominations : unit -> Api.FutureDenom.t list
|
||||
val find_signkey : eddsa_pub -> Signkey.t option
|
||||
val find_denomination : denom_hash -> Denomination.t option
|
||||
val find_future_signkey : eddsa_pub -> Api.FutureSignKey.t option
|
||||
val find_future_denomination : denom_hash -> Api.FutureDenom.t option
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue