From e5a8ae7d60c9fc9d6740ef391ac34f2ac620b0f4 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 20 Jun 2023 16:07:15 +0200 Subject: wallet-core: remove redundant/unused notifications --- packages/taler-harness/src/harness/helpers.ts | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'packages/taler-harness/src/harness/helpers.ts') diff --git a/packages/taler-harness/src/harness/helpers.ts b/packages/taler-harness/src/harness/helpers.ts index 6f70b9455..bc2f573e9 100644 --- a/packages/taler-harness/src/harness/helpers.ts +++ b/packages/taler-harness/src/harness/helpers.ts @@ -30,8 +30,8 @@ import { Duration, PreparePayResultType, NotificationType, - WithdrawalGroupFinishedNotification, WalletNotification, + TransactionMajorState, } from "@gnu-taler/taler-util"; import { BankAccessApi, @@ -505,7 +505,7 @@ export async function startWithdrawViaBank( } export interface WithdrawViaBankResult { - withdrawalFinishedCond: Promise; + withdrawalFinishedCond: Promise; } /** @@ -535,17 +535,22 @@ export async function withdrawViaBankV2( restrictAge: p.restrictAge, }); - const withdrawalFinishedCond = wallet.waitForNotificationCond((x) => - x.type === NotificationType.WithdrawGroupFinished ? x : false, - ); - // Withdraw (AKA select) - await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, { - exchangeBaseUrl: exchange.baseUrl, - talerWithdrawUri: wop.taler_withdraw_uri, - restrictAge: p.restrictAge, - }); + const acceptRes = await wallet.client.call( + WalletApiOperation.AcceptBankIntegratedWithdrawal, + { + exchangeBaseUrl: exchange.baseUrl, + talerWithdrawUri: wop.taler_withdraw_uri, + restrictAge: p.restrictAge, + }, + ); + + const withdrawalFinishedCond = wallet.waitForNotificationCond((x) => + x.type === NotificationType.TransactionStateTransition && + x.newTxState.major === TransactionMajorState.Done && + x.transactionId === acceptRes.transactionId, + ); // Confirm it -- cgit v1.2.3