From 6dedca0fa36bd30bbeb26be012ce3ac9d967065a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= <oec-taler@kesim.org>
Date: Fri, 28 Jul 2023 23:27:02 +0200
Subject: taler_amount type introduced in reserves table and corresponding
 functions

- current_balance is now a taler_amount
- all C-functions, SQL-statements and stored procedures adjusted accordingly.

=> make check passes all tests in testing.
---
 src/exchangedb/exchange_do_batch_withdraw_insert.sql | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

(limited to 'src/exchangedb/exchange_do_batch_withdraw_insert.sql')

diff --git a/src/exchangedb/exchange_do_batch_withdraw_insert.sql b/src/exchangedb/exchange_do_batch_withdraw_insert.sql
index b580f6fb7..fd00754ad 100644
--- a/src/exchangedb/exchange_do_batch_withdraw_insert.sql
+++ b/src/exchangedb/exchange_do_batch_withdraw_insert.sql
@@ -16,8 +16,7 @@
 
 CREATE OR REPLACE FUNCTION exchange_do_batch_withdraw_insert(
   IN cs_nonce BYTEA,
-  IN amount_val INT8,
-  IN amount_frac INT4,
+  IN amount taler_amount,
   IN h_denom_pub BYTEA, -- FIXME: denom_serials should really be a parameter to this FUNCTION.
   IN ruuid INT8,
   IN reserve_sig BYTEA,
@@ -74,8 +73,8 @@ VALUES
   ,ruuid
   ,reserve_sig
   ,now
-  ,amount_val
-  ,amount_frac)
+  ,amount.val
+  ,amount.frac)
 ON CONFLICT DO NOTHING;
 
 IF NOT FOUND
@@ -119,6 +118,6 @@ END IF;
 
 END $$;
 
-COMMENT ON FUNCTION exchange_do_batch_withdraw_insert(BYTEA, INT8, INT4, BYTEA, INT8, BYTEA, BYTEA, BYTEA, INT8)
+COMMENT ON FUNCTION exchange_do_batch_withdraw_insert(BYTEA, taler_amount, BYTEA, INT8, BYTEA, BYTEA, BYTEA, INT8)
   IS 'Stores information about a planchet for a batch withdraw operation. Checks if the planchet already exists, and in that case indicates a conflict';
 
-- 
cgit v1.2.3

