This commit is contained in:
swrup 2025-12-11 08:55:52 +01:00
parent 2d67963656
commit be56240ddc
2 changed files with 27 additions and 31 deletions

View file

@ -203,12 +203,11 @@ let insert_auditor =
is_active, last_change) VALUES ($1, $2, $3, true, $4)"
in
fun (module Conn : CONN)
~auditor_pub
~auditor_url
~auditor_name
~start_date
Api.AuditorSetupMessage.
{ auditor_url; auditor_name; auditor_pub; master_sig= _; validity_start }
->
Conn.exec insert_auditor (auditor_pub, auditor_name, auditor_url, start_date)
Conn.exec insert_auditor
(auditor_pub, auditor_name, auditor_url, validity_start)
let update_auditor =
let update_auditor =
@ -217,14 +216,20 @@ let update_auditor =
last_change=$5 WHERE auditor_pub=$1"
in
fun (module Conn : CONN)
~auditor_pub
~auditor_url
~auditor_name
~change_date
~enabled
Api.AuditorSetupMessage.
{ auditor_url; auditor_name; auditor_pub; master_sig= _; validity_start }
->
Conn.exec update_auditor
(auditor_pub, auditor_url, auditor_name, enabled, change_date)
(auditor_pub, auditor_url, auditor_name, true, validity_start)
let disable_auditor =
let update_auditor =
Caqti_type.(t5 eddsa_pub string string bool time ->. unit)
"UPDATE auditors SET auditor_url=$2, auditor_name=$3, is_active=$4, \
last_change=$5 WHERE auditor_pub=$1"
in
fun (module Conn : CONN) ~auditor_pub ~change_date ->
Conn.exec update_auditor (auditor_pub, "", "", false, change_date)
let lookup_wire_fee_by_time =
let lookup_wire_fee_by_time =
@ -391,7 +396,8 @@ let disable_wire =
let disable_wire =
(* TODO
check syntax on this
don't erase old values with null and just change `is_active` and `last_change`? *)
don't erase old values with null and just change `is_active` and `last_change`?
or re-use the update query *)
Caqti_type.(t2 payto_uri time ->. unit)
"UPDATE wire_accounts SET is_active=false, conversion_url=NULL, \
debit_restrictions=NULL::TEXT::JSONB, \