diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-08-25 22:10:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-08-25 22:10:37 +0200 |
commit | 962fff994be6c4db36840bd2bd1dda4bc968ceec (patch) | |
tree | 593131c2b75382f03c007465afa162bd575123ed | |
parent | 5f1567bd775aeb245bc4847ce5d76ccd1607de30 (diff) |
misc wire auditor bugfixes
-rwxr-xr-x | src/auditor/generate-auditor-basedb.sh | 12 | ||||
-rw-r--r-- | src/auditor/taler-helper-auditor-wire-debit.c | 8 | ||||
-rwxr-xr-x | src/auditor/test-auditor.sh | 9 | ||||
-rwxr-xr-x | src/auditor/test-kyc.sh | 2 |
4 files changed, 21 insertions, 10 deletions
diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh index 82549de27..ae695f450 100755 --- a/src/auditor/generate-auditor-basedb.sh +++ b/src/auditor/generate-auditor-basedb.sh @@ -80,7 +80,7 @@ curl -H "Content-Type: application/json" -X POST -d '{"auth":{"method":"external echo " DONE" echo -n "Setting up merchant account ..." -FORTYTHREE="payto://iban/SANDBOXX/DE474361?receiver-name=Merchant43" +FORTYTHREE="payto://iban/DE474361?receiver-name=Merchant43" STATUS=$(curl -H "Content-Type: application/json" -X POST \ "${MERCHANT_URL}private/accounts" \ -d '{"payto_uri":"'"$FORTYTHREE"'"}' \ @@ -92,6 +92,16 @@ then fi echo " DONE" +echo -n "Setting up libeufin merchant account ..." +libeufin-bank create-account \ + --config="${CONF}" \ + --name="Merchant43" \ + --username="Merchant43" \ + --password="X" \ + --payto_uri="payto://iban/DE474361?receiver-name=Merchant43" + +echo " DONE" + # delete existing wallet database export WALLET_DB="wallet.wdb" rm -f "$WALLET_DB" diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c index a654f8354..de4b71dac 100644 --- a/src/auditor/taler-helper-auditor-wire-debit.c +++ b/src/auditor/taler-helper-auditor-wire-debit.c @@ -913,7 +913,7 @@ check_profit_drain (struct ReserveOutInfo *roi) roi->details.credit_account_uri)) { struct TALER_AUDITORDB_WireOutInconsistency woi = { - .row_id = serial, + .wire_out_row_id = serial, .destination_account = (char *) roi->details.credit_account_uri, .diagnostic = "profit drain wired to invalid account", .expected = roi->details.amount, @@ -942,7 +942,7 @@ check_profit_drain (struct ReserveOutInfo *roi) &roi->details.amount)) { struct TALER_AUDITORDB_WireOutInconsistency woi = { - .row_id = roi->details.serial_id, + .wire_out_row_id = roi->details.serial_id, .destination_account = (char *) roi->details.credit_account_uri, .diagnostic = "incorrect amount drained to correct account", .expected = roi->details.amount, @@ -1020,9 +1020,9 @@ complain_out_not_found (void *cls, { struct TALER_AUDITORDB_WireOutInconsistency woi = { - .row_id = roi->details.serial_id, .destination_account = (char *) roi->details.credit_account_uri, .diagnostic = "missing justification for outgoing wire transfer", + .wire_out_row_id = roi->details.serial_id, .expected = zero, .claimed = roi->details.amount }; @@ -1129,7 +1129,7 @@ wire_out_cb ( we should count the wire transfer as entirely spurious, and additionally consider the justified wire transfer as missing. */ struct TALER_AUDITORDB_WireOutInconsistency woi = { - .row_id = rowid, + .wire_out_row_id = rowid, .destination_account = (char *) payto_uri, .diagnostic = "receiver account mismatch", .expected = *amount, diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh index bd182d046..5508d4b00 100755 --- a/src/auditor/test-auditor.sh +++ b/src/auditor/test-auditor.sh @@ -124,6 +124,7 @@ function pre_audit () { exit_skip "Failed to launch libeufin-bank" fi echo " DONE" + if [ "${1:-no}" = "aggregator" ] then echo -n "Running exchange aggregator ..." @@ -357,7 +358,7 @@ function run_audit () { -L DEBUG \ -c "${CONF}" \ drain TESTKUDOS:0.1 \ - exchange-account-1 payto://iban/SANDBOXX/DE360679?receiver-name=Exchange+Drain \ + exchange-account-1 payto://iban/DE360679?receiver-name=Exchange+Drain \ upload \ 2> "${MY_TMP_DIR}/taler-exchange-offline-drain.log" \ || exit_fail "offline draining failed" @@ -1137,7 +1138,7 @@ function test_9() { #exit 0 #OLD_ID=$(echo "SELECT id FROM NexusBankTransactions WHERE amount='10' AND currency='TESTKUDOS' ORDER BY id LIMIT 1;" | psql "${DB}" -Aqt) #OLD_ACC=$(echo 'SELECT "incomingPaytoUri" FROM TalerIncomingPayments WHERE payment='"'$OLD_ID';" | psql "${DB}" -Aqt) - #echo "UPDATE TalerIncomingPayments SET \"incomingPaytoUri\"='payto://iban/SANDBOXX/DE144373?receiver-name=New+Exchange+Company' WHERE payment='$OLD_ID';" \ + #echo "UPDATE TalerIncomingPayments SET \"incomingPaytoUri\"='payto://iban/DE144373?receiver-name=New+Exchange+Company' WHERE payment='$OLD_ID';" \ # | psql "${DB}" -q run_audit @@ -1234,7 +1235,7 @@ function test_11() { # | psql "${DB}" -q # Now populate the TWG table that accounts for outgoing payments, in # order to let /history/outgoing return one result. - #echo -e "INSERT INTO TalerRequestedPayments (facade,payment,\"requestUid\",amount,\"exchangeBaseUrl\",wtid,\"creditAccount\") VALUES (1,1,'unused','TESTKUDOS:10','http://exchange.example.com/','CK9QBFY972KR32FVA1MW958JWACEB6XCMHHKVFMCH1A780Q12SVG','payto://iban/SANDBOXX/""$OTHER_IBAN""?receiver-name=Forty+Two')" \ + #echo -e "INSERT INTO TalerRequestedPayments (facade,payment,\"requestUid\",amount,\"exchangeBaseUrl\",wtid,\"creditAccount\") VALUES (1,1,'unused','TESTKUDOS:10','http://exchange.example.com/','CK9QBFY972KR32FVA1MW958JWACEB6XCMHHKVFMCH1A780Q12SVG','payto://iban/""$OTHER_IBAN""?receiver-name=Forty+Two')" \ # | psql "${DB}" -q run_audit @@ -2025,7 +2026,7 @@ function test_27() { # # point to any record. That's only needed to set a non null value. # echo -e "INSERT INTO PaymentInitiations (\"bankAccount\",\"preparationDate\",\"submissionDate\",sum,currency,\"endToEndId\",\"paymentInformationId\",\"instructionId\",subject,\"creditorIban\",\"creditorBic\",\"creditorName\",submitted,\"messageId\",\"rawConfirmation\") VALUES (1,$(date +%s),$(( $(date +%s) + 2)),10,'TESTKUDOS','NOTGIVEN','unused','unused','$WTID http://exchange.example.com/','$OTHER_IBAN','SANDBOXX','Forty Two',false,1,2)" \ # | psql "${DB}" -q - # echo -e "INSERT INTO TalerRequestedPayments (facade,payment,\"requestUid\",amount,\"exchangeBaseUrl\",wtid,\"creditAccount\") VALUES (1,2,'unused','TESTKUDOS:1','http://exchange.example.com/','$WTID','payto://iban/SANDBOXX/$OTHER_IBAN?receiver-name=Forty+Two')" \ + # echo -e "INSERT INTO TalerRequestedPayments (facade,payment,\"requestUid\",amount,\"exchangeBaseUrl\",wtid,\"creditAccount\") VALUES (1,2,'unused','TESTKUDOS:1','http://exchange.example.com/','$WTID','payto://iban/$OTHER_IBAN?receiver-name=Forty+Two')" \ # | psql "${DB}" -q # launch_libeufin # audit_only diff --git a/src/auditor/test-kyc.sh b/src/auditor/test-kyc.sh index f45b7b3a4..f90350184 100755 --- a/src/auditor/test-kyc.sh +++ b/src/auditor/test-kyc.sh @@ -342,7 +342,7 @@ function run_audit () { -L DEBUG \ -c "${CONF}" \ drain TESTKUDOS:0.1 \ - exchange-account-1 payto://iban/SANDBOXX/DE360679?receiver-name=Exchange+Drain \ + exchange-account-1 payto://iban/DE360679?receiver-name=Exchange+Drain \ upload \ 2> "${MY_TMP_DIR}/taler-exchange-offline-drain.log" \ || exit_fail "offline draining failed" |