From a1dae0199f3bc3e9f66fc1375c652c6f99b26b2c Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Fri, 28 Jul 2023 19:01:57 +0200 Subject: FAILING attempt to make echange.reserve use taler_amount Fails with > TALER_PREFIX=/usr/local ./test-exchangedb-postgres 2023-07-28T19:02:25.150845+0200 /home/oec/projects/taler/exchange/src/exchangedb/.libs/test-exchangedb-postgres-2559159 WARNING Could not run PSQL on file /usr/local/share/taler//sql/exchange/drop.sql: psql exit code was 3 2023-07-28T19:02:32.488085+0200 pq-2559159 ERROR Query `call_withdraw' failed with result: invalid input syntax for type bigint: "(1,1000)"/(null)/ERROR: invalid input syntax for type bigint: "(1,1000)" CONTEXT: PL/pgSQL function exchange_do_withdraw(bytea,taler_amount,bytea,bytea,bytea,bytea,bytea,bigint,bigint,boolean) line 23 at SQL statement /PGRES_FATAL_ERROR/ERROR: invalid input syntax for type bigint: "(1,1000)" CONTEXT: PL/pgSQL function exchange_do_withdraw(bytea,taler_amount,bytea,bytea,bytea,bytea,bytea,bigint,bigint,boolean) line 23 at SQL statement 2023-07-28T19:02:32.488146+0200 /home/oec/projects/taler/exchange/src/exchangedb/.libs/test-exchangedb-postgres-2559159 ERROR Assertion failed at test_exchangedb.c:1428. --- src/exchangedb/pg_do_batch_withdraw_insert.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/pg_do_batch_withdraw_insert.c') diff --git a/src/exchangedb/pg_do_batch_withdraw_insert.c b/src/exchangedb/pg_do_batch_withdraw_insert.c index 8be18f7c..2952483c 100644 --- a/src/exchangedb/pg_do_batch_withdraw_insert.c +++ b/src/exchangedb/pg_do_batch_withdraw_insert.c @@ -41,7 +41,8 @@ TEH_PG_do_batch_withdraw_insert ( NULL == nonce ? GNUNET_PQ_query_param_null () : GNUNET_PQ_query_param_auto_from_type (nonce), - TALER_PQ_query_param_amount (&collectable->amount_with_fee), + TALER_PQ_query_param_amount_tuple (pg->conn, + &collectable->amount_with_fee), GNUNET_PQ_query_param_auto_from_type (&collectable->denom_pub_hash), GNUNET_PQ_query_param_uint64 (&ruuid), GNUNET_PQ_query_param_auto_from_type (&collectable->reserve_sig), @@ -69,7 +70,7 @@ TEH_PG_do_batch_withdraw_insert ( ",out_conflict AS conflict" ",out_nonce_reuse AS nonce_reuse" " FROM exchange_do_batch_withdraw_insert" - " ($1,$2,$3,$4,$5,$6,$7,$8,$9);"); + " ($1,$2,$3,$4,$5,$6,$7,$8);"); return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "call_batch_withdraw_insert", params, -- cgit v1.2.3