aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_do_refund.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-29 23:01:06 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-29 23:01:15 +0200
commite47e5c0cfba7746263775e8bbd4064b640f69020 (patch)
tree4d853f7e1d065a198b32dd14d38df179cf288e15 /src/exchangedb/pg_do_refund.c
parentecf6b2750bb6ed9157aece72602dd042a50e36f3 (diff)
downloadexchange-e47e5c0cfba7746263775e8bbd4064b640f69020.tar.xz
migration to new amount style for exchangedb
Diffstat (limited to 'src/exchangedb/pg_do_refund.c')
-rw-r--r--src/exchangedb/pg_do_refund.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/exchangedb/pg_do_refund.c b/src/exchangedb/pg_do_refund.c
index 0b9665c48..887b610bd 100644
--- a/src/exchangedb/pg_do_refund.c
+++ b/src/exchangedb/pg_do_refund.c
@@ -25,6 +25,8 @@
#include "pg_do_refund.h"
#include "pg_helper.h"
#include "pg_compute_shard.h"
+
+
enum GNUNET_DB_QueryStatus
TEH_PG_do_refund (
void *cls,
@@ -40,9 +42,12 @@ TEH_PG_do_refund (
uint64_t deposit_shard = TEH_PG_compute_shard (&refund->details.merchant_pub);
struct TALER_Amount amount_without_fee;
struct GNUNET_PQ_QueryParam params[] = {
- TALER_PQ_query_param_amount (&refund->details.refund_amount),
- TALER_PQ_query_param_amount (&amount_without_fee),
- TALER_PQ_query_param_amount (deposit_fee),
+ TALER_PQ_query_param_amount_tuple (pg->conn,
+ &refund->details.refund_amount),
+ TALER_PQ_query_param_amount_tuple (pg->conn,
+ &amount_without_fee),
+ TALER_PQ_query_param_amount_tuple (pg->conn,
+ deposit_fee),
GNUNET_PQ_query_param_auto_from_type (&refund->details.h_contract_terms),
GNUNET_PQ_query_param_uint64 (&refund->details.rtransaction_id),
GNUNET_PQ_query_param_uint64 (&deposit_shard),
@@ -72,7 +77,6 @@ TEH_PG_do_refund (
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
}
- /* Used in #postgres_do_refund() to refund a deposit. */
PREPARE (pg,
"call_refund",
"SELECT "
@@ -81,8 +85,7 @@ TEH_PG_do_refund (
",out_gone AS gone"
",out_conflict AS conflict"
" FROM exchange_do_refund"
- " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13);");
-
+ " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10);");
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"call_refund",
params,