- current_balance is now a taler_amount
- all C-functions, SQL-statements and stored procedures adjusted accordingly.
=> make check passes all tests in testing.
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.
- 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.
age-withdraw successfully tested (no reveal yet):
1. reserve filled with amount large enough to trigger kyc
2. kyc oauth2 test daemon sets birthday to 2015-00-00
3. usual withdraw fails with CONFLICT and AGE_RESTRICTION_REQUIRED
4. age-withdraw with loo large of an maximum age fails
5. age-withdraw with appropriate maximum age succeeds
1. Added age-requirement check in withdraw-handler (like in batch-withdraw)
2. In test_exchange_api_age_restriction:
- kyc-oauth2 started, with static birthdate in answers
- withdraw triggers kyc
- second withdraw fails due to age restriction requirements
Where applicable, the reserve_pub will be passed on to the
kcy-legitimization process and persisted along with h_payto.
This allows us to set a birthday on the reserve itself, once a
related kyc-process has provided one.