From b64a91207ce6fd7d1709aba717e756d21497df8c Mon Sep 17 00:00:00 2001 From: swrup Date: Sun, 7 Dec 2025 16:39:12 +0100 Subject: [PATCH] caqti amount: shorter syntax for output param --- src/pg.ml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pg.ml b/src/pg.ml index d958c6a6..a8f28e73 100644 --- a/src/pg.ml +++ b/src/pg.ml @@ -7,7 +7,10 @@ GNU Taler db-events? it seems caqti/pgx does not support it *) +module type CONN = Caqti_miou.CONNECTION + open Crypto +open Bin_type module Caqti_type = struct include Caqti_type @@ -31,7 +34,6 @@ module Caqti_type = struct include struct (* alias for hash *) - open Bin_type let fullpayto_hash = FullPaytoHash.caqti let nomalizaedpayto_hash = NormalizedPaytoHash.caqti @@ -49,10 +51,6 @@ module Caqti_type = struct include Caqti_request.Infix end -module type CONN = Caqti_miou.CONNECTION - -open Bin_type - let preflight = let l = List.map @@ -107,10 +105,8 @@ let lookup_denomination_key = denomination_hash ->? t10 time time time time amount amount amount amount amount age_mask) "SELECT valid_from, expire_withdraw, expire_deposit, expire_legal, \ - (coin).val, (coin).frac, (fee_withdraw).val, (fee_withdraw).frac, \ - (fee_deposit).val, (fee_deposit).frac, (fee_refresh).val, \ - (fee_refresh).frac, (fee_refund).val, (fee_refund).frac, age_mask FROM \ - denominations WHERE denom_pub_hash=$1" + (coin).*, (fee_withdraw).*, (fee_deposit).*, (fee_refresh).*, \ + (fee_refund).*, 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