From 5695ae0a9f469ddbcd86e675f8f74b30032be457 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 1 Jul 2023 01:43:29 +0200 Subject: wallet-core: use testingWaitTransactionsFinal to wait for transactions --- packages/taler-wallet-core/src/operations/testing.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/testing.ts') diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts index 8c84702b8..ea373e914 100644 --- a/packages/taler-wallet-core/src/operations/testing.ts +++ b/packages/taler-wallet-core/src/operations/testing.ts @@ -450,7 +450,7 @@ export async function runIntegrationTest( logger.trace("integration test: all done!"); } -async function waitUntilDone(ws: InternalWalletState): Promise { +export async function waitUntilDone(ws: InternalWalletState): Promise { logger.info("waiting until all transactions are in a final state"); ws.ensureTaskLoopRunning(); let p: OpenedPromise | undefined = undefined; @@ -459,11 +459,13 @@ async function waitUntilDone(ws: InternalWalletState): Promise { return; } if (notif.type === NotificationType.TransactionStateTransition) { - p.resolve(); - } - // Work-around, refresh transactions don't properly emit transition notifications yet. - if (notif.type === NotificationType.PendingOperationProcessed) { - p.resolve(); + switch (notif.newTxState.major) { + case TransactionMajorState.Pending: + case TransactionMajorState.Aborting: + break; + default: + p.resolve(); + } } }); while (1) { -- cgit v1.2.3