summaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_transfer_tracking.sh
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-12-21 09:43:33 +0800
committerChristian Grothoff <grothoff@gnunet.org>2023-12-21 09:43:33 +0800
commit4f8d213a56eaff3d9841c73656faf669663564c9 (patch)
tree18c56cd332e9e391628159f9d256153a9ebf2326 /src/testing/test_merchant_transfer_tracking.sh
parente41f0babfc13a18c0dd3889a6801a3e7944925c5 (diff)
downloadmerchant-4f8d213a56eaff3d9841c73656faf669663564c9.tar.gz
merchant-4f8d213a56eaff3d9841c73656faf669663564c9.tar.bz2
merchant-4f8d213a56eaff3d9841c73656faf669663564c9.zip
fix tests: check for libeufin-bank, not libeufin-cli
Diffstat (limited to 'src/testing/test_merchant_transfer_tracking.sh')
-rwxr-xr-xsrc/testing/test_merchant_transfer_tracking.sh41
1 files changed, 12 insertions, 29 deletions
diff --git a/src/testing/test_merchant_transfer_tracking.sh b/src/testing/test_merchant_transfer_tracking.sh
index b9c8cb2f..6be6b7a5 100755
--- a/src/testing/test_merchant_transfer_tracking.sh
+++ b/src/testing/test_merchant_transfer_tracking.sh
@@ -20,6 +20,8 @@
set -eu
+. setup.sh
+
# Replace with 0 for nexus...
USE_FAKEBANK=1
if [ 1 = "$USE_FAKEBANK" ]
@@ -29,18 +31,15 @@ then
BANK_FLAGS="-f -d $WIRE_METHOD -u $ACCOUNT"
BANK_URL="http://localhost:8082/"
else
+ echo -n "Testing for libeufin-bank"
+ libeufin-bank --help >/dev/null </dev/null || exit_skip " MISSING"
+ echo " FOUND"
ACCOUNT="exchange-account-1"
WIRE_METHOD="iban"
BANK_FLAGS="-ns -d $WIRE_METHOD -u $ACCOUNT"
BANK_URL="http://localhost:18082/"
fi
-. setup.sh
-
-# If CLI is installed, assume all the suite is.
-echo -n "Testing for libeufin(-cli)"
-libeufin-cli --help >/dev/null </dev/null || exit_skip " MISSING"
-echo " FOUND"
echo -n "Testing for taler-harness"
taler-harness --help >/dev/null </dev/null || exit_skip " MISSING"
@@ -256,29 +255,13 @@ echo " DONE"
echo -n "Obtaining wire transfer details from bank..."
-if [ 1 = "$USE_FAKEBANK" ]
-then
- BANKDATA="$(curl 'http://localhost:8082/accounts/exchange/taler-wire-gateway/history/outgoing?delta=1' -s)"
- WTID=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].wtid)
- WURL=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].exchange_base_url)
- CREDIT_AMOUNT=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].amount)
- TARGET_PAYTO=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].credit_account)
- TARGET=$(echo "$TARGET_PAYTO" | awk -F = '{print $2}')
-else
- echo -n "waiting for Nexus and Sandbox to settle the payment .."
- sleep 3
- echo " DONE"
- # Emulating the previous pybank-based logic of getting
- # the wire transfer information _via the exchange_ bank
- # account. NOTE: grabbing tx == 0, since the latest
- # transaction appear first in the bank's history.
- BANKDATA=$(get_bankaccount_transactions exchange x | jq '.transactions[0]')
- SUBJECT=$(echo "$BANKDATA" | jq -r .subject)
- WTID=$(echo "$SUBJECT" | awk '{print $1}')
- WURL=$(echo "$SUBJECT" | awk '{print $2}')
- CREDIT_AMOUNT=$(echo "$BANKDATA" | jq -r .currency):$(echo "$BANKDATA" | jq -r .amount)
- TARGET=$(echo "$BANKDATA" | jq -r .creditorIban)
-fi
+BANKDATA="$(curl 'http://localhost:8082/accounts/exchange/taler-wire-gateway/history/outgoing?delta=1' -s)"
+WTID=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].wtid)
+WURL=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].exchange_base_url)
+CREDIT_AMOUNT=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].amount)
+TARGET_PAYTO=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].credit_account)
+TARGET=$(echo "$TARGET_PAYTO" | awk -F = '{print $2}')
+
# Figure out which account got paid, in order to
# resort the right (and complete: including the receiver-name)
# TARGET_PAYTO