offline tool: add wire-fee cmd
This commit is contained in:
parent
6ee1a994ad
commit
17be86bfd4
5 changed files with 111 additions and 21 deletions
|
|
@ -525,9 +525,6 @@ end
|
|||
module WireFeeSetupMessage = struct
|
||||
type t = {
|
||||
wire_method: string;
|
||||
(* TODO over which struct?
|
||||
Signature using the exchange's offline key
|
||||
with purpose TALER_SIGNATURE_MASTER_WIRE_FEES *)
|
||||
master_sig_wire: MasterWireFee.t;
|
||||
fee_start: Timestamp.t;
|
||||
fee_end: Timestamp.t;
|
||||
|
|
|
|||
|
|
@ -407,8 +407,19 @@ module Wire_fee = struct
|
|||
match wire_fees with
|
||||
| [] ->
|
||||
let+ () = Pg.insert_wire_fee db_conn v |> unwrap_err_caqti in
|
||||
Logs.info (fun m -> m "added wire fee");
|
||||
()
|
||||
| _l -> Error "wire-fee already setup"
|
||||
| [ vv ] -> (
|
||||
match v.master_sig_wire = vv.sig_ with
|
||||
| false ->
|
||||
Error "a different wire-fee was already setup for this time frame"
|
||||
| true ->
|
||||
Logs.info (fun m -> m "an identical wire-fee was already setup");
|
||||
Ok ())
|
||||
| _ ->
|
||||
Error
|
||||
"invalid database state, multiple wire-fee found in database for \
|
||||
this time frame"
|
||||
|
||||
let jsont = WireFeeSetupMessage.jsont
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue