exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 07c722f9fe3816b0ba855db9530877e36ae36c78
parent b6b8cf29edfcd42bb3a637a0d49d9dc5cb4a746a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 15 Sep 2024 23:26:10 +0200

fix test-19: reserve closure payto URI normalization issue

Diffstat:
Msrc/auditor/taler-helper-auditor-wire-debit.c | 34++++++++++++++++++++++++----------
Msrc/auditor/test-auditor.sh | 36+++++++++++-------------------------
2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c @@ -54,24 +54,24 @@ * created by imperfect clock synchronization and network delay. */ #define TIME_TOLERANCE GNUNET_TIME_relative_multiply ( \ - GNUNET_TIME_UNIT_MINUTES, \ - 15) + GNUNET_TIME_UNIT_MINUTES, \ + 15) /** * How long do we try to long-poll for bank wire transfers? */ #define MAX_LONGPOLL_DELAY GNUNET_TIME_relative_multiply ( \ - GNUNET_TIME_UNIT_HOURS, \ - 1) + GNUNET_TIME_UNIT_HOURS, \ + 1) /** * How long do we wait between polling for bank wire transfers at the minimum? */ #define MIN_LONGPOLL_DELAY GNUNET_TIME_relative_multiply ( \ - GNUNET_TIME_UNIT_MINUTES, \ - 5) + GNUNET_TIME_UNIT_MINUTES, \ + 5) /** @@ -806,8 +806,11 @@ check_reported_inconsistency (struct ReserveOutInfo *roi) if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Deletion of wire out inconsistency %llu failed: not reported missing!\n", - (unsigned long long) roi->details.serial_id); + "Deletion of wire out inconsistency %llu (%s, %s, %s) failed: not reported missing!\n", + (unsigned long long) roi->details.serial_id, + roi->details.credit_account_uri, + diag, + TALER_amount2s (&roi->details.amount)); return GNUNET_NO; } TALER_ARL_amount_subtract (&TALER_ARL_USE_AB (total_bad_amount_out_minus), @@ -1000,6 +1003,10 @@ complain_out_not_found (void *cls, hash_rc (roi->details.credit_account_uri, &roi->details.wtid, &rkey); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Checking for reserve closure %s benefiting %s\n", + GNUNET_h2s (&rkey), + roi->details.credit_account_uri); GNUNET_CONTAINER_multihashmap_get_multiple (reserve_closures, &rkey, &check_rc_matches, @@ -1540,9 +1547,15 @@ reserve_closed_cb ( rc->wtid = *wtid; rc->execution_date = execution_date; rc->rowid = rowid; - hash_rc (receiver_account, + hash_rc (rc->receiver_account, wtid, &key); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Discovered reserve closure %llu (%s) over %s benefiting %s\n", + (unsigned long long) rowid, + GNUNET_h2s (&key), + TALER_amount2s (amount_with_fee), + receiver_account); (void) GNUNET_CONTAINER_multihashmap_put ( reserve_closures, &key, @@ -1664,7 +1677,8 @@ begin_transaction (void) "Resuming wire debit audit at %llu\n", (unsigned long long) TALER_ARL_USE_PP (wire_reserve_close_id)); } - + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Iterating over reserve closures\n"); qs = TALER_ARL_edb->select_reserve_closed_above_serial_id ( TALER_ARL_edb->cls, TALER_ARL_USE_PP (wire_reserve_close_id), diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh @@ -641,9 +641,7 @@ function test_0() { "Wrong arithmetic delta minus from reserves" echo -n "Checking for unexpected wire out differences " - call_endpoint "wire-out-inconsistency" - jq -e .wire_out_inconsistency[0] < "${MY_TMP_DIR}/wire-out-inconsistency.json" > /dev/null && exit_fail "Unexpected wire out inconsistencies detected in ordinary run" - echo "PASS" + check_no_report "wire-out-inconsistency" # cannot easily undo aggregator, hence full reload full_reload @@ -1535,7 +1533,6 @@ function test_18() { # Test where reserve closure was done properly -# FIXME: test-19 partially implemented function test_19() { echo "===========19: reserve closure done properly =================" @@ -1551,30 +1548,19 @@ function test_19() { | psql -Aqt "$DB" echo "UPDATE exchange.reserves SET current_balance.val=${VAL_DELTA}+(current_balance).val,expiration_date='${NEW_EXP}' WHERE reserve_pub='${RES_PUB}';" \ | psql -Aqt "$DB" -#TODO fix helper wire # Need to run with the aggregator so the reserve closure happens - #run_audit aggregator - check_auditor_running - - call_endpoint "reserve-not-closed-inconsistency" - - echo -n "Testing reserve closure was done correctly... " - - jq -e .reserve_not_closed_inconsistencies[0] \ - < "${MY_TMP_DIR}/reserve-not-closed-inconsistency.json" > /dev/null \ - && exit_fail "Unexpected reserve not closed inconsistency detected" - - echo "PASS" - - #TODO fix helepr wire - #echo -n "Testing no bogus transfers detected... " - #jq -e .wire_out_amount_inconsistencies[0] < test-audit-wire.json > /dev/null && exit_fail "Unexpected wire out inconsistency detected in run with reserve closure" + run_audit aggregator + check_auditor_running - echo "PASS" + echo -n "Testing reserve closure was done correctly... " + check_no_report "reserve-not-closed-inconsistency" +# FIXME: test-19 fails here: + echo -n "Testing no bogus transfers detected... " + check_no_report "wire-out-inconsistency" - # cannot easily undo aggregator, hence full reload - full_reload - stop_auditor_httpd + # cannot easily undo aggregator, hence full reload + full_reload + stop_auditor_httpd }