diff options
author | Florian Dold <florian@dold.me> | 2023-07-01 01:43:29 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-07-01 01:43:29 +0200 |
commit | 5695ae0a9f469ddbcd86e675f8f74b30032be457 (patch) | |
tree | daf5f7de0d9c3549ac9acf6dde4189a2ddbe3ec9 /packages/taler-wallet-core/src/operations/testing.ts | |
parent | f93ab03a1b946af441e35b9c057f129d25311273 (diff) | |
download | wallet-core-5695ae0a9f469ddbcd86e675f8f74b30032be457.tar.xz |
wallet-core: use testingWaitTransactionsFinal to wait for transactions
Diffstat (limited to 'packages/taler-wallet-core/src/operations/testing.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/testing.ts | 14 |
1 files changed, 8 insertions, 6 deletions
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<void> { +export async function waitUntilDone(ws: InternalWalletState): Promise<void> { logger.info("waiting until all transactions are in a final state"); ws.ensureTaskLoopRunning(); let p: OpenedPromise<void> | undefined = undefined; @@ -459,11 +459,13 @@ async function waitUntilDone(ws: InternalWalletState): Promise<void> { 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) { |