This commit is contained in:
swrup 2025-12-07 04:06:51 +01:00
parent ac0b346877
commit 6c527c1dcc

View file

@ -15,6 +15,7 @@ module Caqti_type = struct
custom
~encode:(fun amount -> Ok (amount.value, amount.fraction))
~decode:(fun (value, fraction) ->
Fmt.epr "amount decode {value = %Ld; fract = %ld}" value fraction;
Amount.make ~sign:None ~currency:Config.currency ~value ~fraction)
(t2 int64 int32)
@ -110,9 +111,11 @@ let lookup_denomination_key =
Caqti_type.(
denomination_hash
->? t10 time time time time amount amount amount amount amount age_mask)
"SELECT valid_from, expire_withdraw, expire_deposit, expire_legal, coin, \
fee_withdraw, fee_deposit, fee_refresh, fee_refund, age_mask FROM \
denominations WHERE denom_pub_hash=$1"
"SELECT valid_from, expire_withdraw, expire_deposit, expire_legal, \
coin::taler_amount, fee_withdraw::taler_amount, \
fee_deposit::taler_amount, fee_refresh::taler_amount, \
fee_refund::taler_amount, age_mask FROM denominations WHERE \
denom_pub_hash=$1"
in
fun (module Conn : CONN) (h_denom_pub : DenominationHash.t) ->
Conn.find_opt lookup_denomination_key h_denom_pub