aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-08-24 19:44:24 +0200
committerFlorian Dold <florian@dold.me>2022-08-24 19:44:24 +0200
commit42c2b7508f898ccce4305d56084ced971d99ed52 (patch)
tree712257afe6d0a5ce9af079074e6615f32c295a97 /packages/taler-wallet-cli
parentd32d2895cedad656d7130522722f40642c439de6 (diff)
wallet-core: fix withdrawal idempotency
Diffstat (limited to 'packages/taler-wallet-cli')
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts
index e8a8c5028..dc7298e5d 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts
@@ -24,6 +24,7 @@ import {
BankApi,
BankAccessApi,
} from "@gnu-taler/taler-wallet-core";
+import { j2s } from "@gnu-taler/taler-util";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -62,6 +63,14 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
talerWithdrawUri: wop.taler_withdraw_uri,
},
);
+ // Do it twice to check idempotency
+ const r3 = await wallet.client.call(
+ WalletApiOperation.AcceptBankIntegratedWithdrawal,
+ {
+ exchangeBaseUrl: exchange.baseUrl,
+ talerWithdrawUri: wop.taler_withdraw_uri,
+ },
+ );
await wallet.runPending();
// Confirm it
@@ -75,7 +84,8 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
const balResp = await wallet.client.call(WalletApiOperation.GetBalances, {});
t.assertAmountEquals("TESTKUDOS:9.72", balResp.balances[0].available);
- await t.shutdown();
+ const txn = await wallet.client.call(WalletApiOperation.GetTransactions, {});
+ console.log(`transactions: ${j2s(txn)}`);
}
runWithdrawalBankIntegratedTest.suites = ["wallet"];