diff options
author | Florian Dold <florian@dold.me> | 2023-06-20 16:07:15 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-20 16:07:20 +0200 |
commit | e5a8ae7d60c9fc9d6740ef391ac34f2ac620b0f4 (patch) | |
tree | 472ddac0bbcf0b80a682672462870de613e8b3c8 /packages/taler-harness/src/harness/helpers.ts | |
parent | a86c948fc9e44e3503cd19776c3eb6410ea3d674 (diff) |
wallet-core: remove redundant/unused notifications
Diffstat (limited to 'packages/taler-harness/src/harness/helpers.ts')
-rw-r--r-- | packages/taler-harness/src/harness/helpers.ts | 27 |
1 files changed, 16 insertions, 11 deletions
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<WithdrawalGroupFinishedNotification>; + withdrawalFinishedCond: Promise<true>; } /** @@ -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 |