aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/0003-age_withdraw.sql
diff options
context:
space:
mode:
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
commit571d43cef3732ed6f491d91a9e767a80008edeb1 (patch)
treeb330d46d7698a07c4cc9c8baf1d2ee7793a4f02a /src/exchangedb/0003-age_withdraw.sql
parent722e00b1e9869e0ff337d40b28f2ed71d8afcd76 (diff)
[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/0003-age_withdraw.sql')
-rw-r--r--src/exchangedb/0003-age_withdraw.sql3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/exchangedb/0003-age_withdraw.sql b/src/exchangedb/0003-age_withdraw.sql
index 9816e466..c85eb60f 100644
--- a/src/exchangedb/0003-age_withdraw.sql
+++ b/src/exchangedb/0003-age_withdraw.sql
@@ -29,8 +29,7 @@ BEGIN
'(age_withdraw_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',h_commitment BYTEA NOT NULL CONSTRAINT h_commitment_length CHECK(LENGTH(h_commitment)=64)'
',max_age SMALLINT NOT NULL CONSTRAINT max_age_positive CHECK(max_age>=0)'
- ',amount_with_fee_val INT8 NOT NULL'
- ',amount_with_fee_frac INT4 NOT NULL'
+ ',amount_with_fee TALER_AMOUNT NOT NULL'
',reserve_pub BYTEA NOT NULL CONSTRAINT reserve_pub_length CHECK(LENGTH(reserve_pub)=32)'
',reserve_sig BYTEA NOT NULL CONSTRAINT reserve_sig_length CHECK(LENGTH(reserve_sig)=64)'
',noreveal_index SMALLINT NOT NULL CONSTRAINT noreveal_index_positive CHECK(noreveal_index>=0)'