do pg revoke in keys.ml

This commit is contained in:
swrup 2026-02-18 18:13:50 +01:00
parent b719f9b9c7
commit 8caf83e90a
2 changed files with 18 additions and 23 deletions

View file

@ -442,18 +442,23 @@ module Make (Conn : Pg.CONN) = struct
let sk = { sk with revoked_sig= Some revoked_sig } in
Hashtbl.replace t.sk_ht pub sk;
(* TODO revoke, apply to database *)
Ok ()
let+ () =
Pg.insert_signkey_revocation conn pub revoked_sig |> unwrap_err_caqti
in
()
let revoke_denomination pub revoked_sig =
match Hashtbl.find_opt t.dn_ht pub with
let revoke_denomination h_pub revoked_sig =
match Hashtbl.find_opt t.dn_ht h_pub with
| None -> Error "Keys revoke_denomination: denomination not found."
| Some dn ->
let dn = { dn with revoked_sig= Some revoked_sig } in
Hashtbl.replace t.dn_ht pub dn;
Hashtbl.replace t.dn_ht h_pub dn;
(* TODO revoke, apply to database *)
Ok ()
let+ () =
Pg.insert_denomination_revocation conn h_pub revoked_sig
|> unwrap_err_caqti
in
()
let save () =
let* () = write_eddsa sm_key_fname t.sm_key in