harness: wait for withdrawal

This commit is contained in:
Florian Dold 2023-09-06 13:28:23 +02:00
parent b63937703c
commit 013252efde
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
4 changed files with 13 additions and 7 deletions

View File

@ -151,13 +151,15 @@ export async function runMerchantExchangeConfusionTest(t: GlobalTestState) {
// Withdraw digital cash into the wallet. // Withdraw digital cash into the wallet.
await withdrawViaBankV2(t, { const wres = await withdrawViaBankV2(t, {
walletClient, walletClient,
bank, bank,
exchange: faultyExchange, exchange: faultyExchange,
amount: "TESTKUDOS:20", amount: "TESTKUDOS:20",
}); });
await wres.withdrawalFinishedCond;
/** /**
* ========================================================================= * =========================================================================
* Create an order and let the wallet pay under a session ID * Create an order and let the wallet pay under a session ID

View File

@ -43,16 +43,18 @@ export async function runPaymentAbortTest(t: GlobalTestState) {
// Withdraw digital cash into the wallet. // Withdraw digital cash into the wallet.
await withdrawViaBankV2(t, { const wres = await withdrawViaBankV2(t, {
walletClient, walletClient,
bank, bank,
exchange: faultyExchange, exchange: faultyExchange,
amount: "TESTKUDOS:20", amount: "TESTKUDOS:20",
}); });
const merchant = faultyMerchant; await wres.withdrawalFinishedCond;
const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); const merchantClient = new MerchantApiClient(
faultyMerchant.makeInstanceBaseUrl(),
);
let orderResp = await merchantClient.createOrder({ let orderResp = await merchantClient.createOrder({
order: { order: {

View File

@ -50,14 +50,14 @@ export async function runPaymentTransientTest(t: GlobalTestState) {
// Withdraw digital cash into the wallet. // Withdraw digital cash into the wallet.
await withdrawViaBankV2(t, { const wres = await withdrawViaBankV2(t, {
walletClient, walletClient,
bank, bank,
exchange: faultyExchange, exchange: faultyExchange,
amount: "TESTKUDOS:20", amount: "TESTKUDOS:20",
}); });
const merchant = faultyMerchant; await wres.withdrawalFinishedCond;
let orderResp = await merchantClient.createOrder({ let orderResp = await merchantClient.createOrder({
order: { order: {

View File

@ -36,13 +36,15 @@ export async function runStoredBackupsTest(t: GlobalTestState) {
// Withdraw digital cash into the wallet. // Withdraw digital cash into the wallet.
await withdrawViaBankV2(t, { const wres = await withdrawViaBankV2(t, {
walletClient, walletClient,
bank, bank,
exchange, exchange,
amount: "TESTKUDOS:20", amount: "TESTKUDOS:20",
}); });
await wres;
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
const sb1Resp = await walletClient.call( const sb1Resp = await walletClient.call(