diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-07-27 23:57:07 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-07-27 23:57:07 +0200 |
commit | 571d43cef3732ed6f491d91a9e767a80008edeb1 (patch) | |
tree | b330d46d7698a07c4cc9c8baf1d2ee7793a4f02a /src/exchangedb/pg_do_age_withdraw.c | |
parent | 722e00b1e9869e0ff337d40b28f2ed71d8afcd76 (diff) | |
download | exchange-571d43cef3732ed6f491d91a9e767a80008edeb1.tar.xz |
[WiP] added TALER_AMOUNT type to Postgres - first in age_withdraw
- Added a type TALER_AMOUNT (val INT8, frac INT4) to Postgres.
- Added PLSQL functions/procedures
- amount_normalize(a)
- amount_add(a, b)
- amount_left_minus_right(l, r, diff, ok bool)
- Added PQ-helper functions
- TALER_PQ_query_param_amount_tuple()
- TALER_PQ_result_spec_amount_tuple()
- In table 'age_withdraw', changed fields 'amount_with_fee_val' and '..._frac'
into single field 'amount_with_fee' be of type TALER_AMOUNT
- Changed functions/stored procedures 'do_age_withdraw' and
'get_age_withdraw' to use new APIs.
=> make check runs through without errors,
age-withdraw and -reveal test passes.
Diffstat (limited to 'src/exchangedb/pg_do_age_withdraw.c')
-rw-r--r-- | src/exchangedb/pg_do_age_withdraw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/exchangedb/pg_do_age_withdraw.c b/src/exchangedb/pg_do_age_withdraw.c index 4fb52d466..0c79f58c9 100644 --- a/src/exchangedb/pg_do_age_withdraw.c +++ b/src/exchangedb/pg_do_age_withdraw.c @@ -44,7 +44,8 @@ TEH_PG_do_age_withdraw ( struct PostgresClosure *pg = cls; struct GNUNET_TIME_Timestamp gc; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount (&commitment->amount_with_fee), + TALER_PQ_query_param_amount_tuple (pg->conn, + &commitment->amount_with_fee), GNUNET_PQ_query_param_auto_from_type (&commitment->reserve_pub), GNUNET_PQ_query_param_auto_from_type (&commitment->reserve_sig), GNUNET_PQ_query_param_timestamp (&now), @@ -96,7 +97,7 @@ TEH_PG_do_age_withdraw ( ",reserve_birthday" ",conflict" " FROM exchange_do_age_withdraw" - " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);"); + " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);"); return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "call_age_withdraw", params, |