diff options
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index e3aca1ac5..45f9e6078 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -55,7 +55,6 @@ import { PrepareWithdrawExchangeRequest, PrepareWithdrawExchangeResponse, RecoverStoredBackupRequest, - RetryLoopOpts, StoredBackupList, TalerError, TalerErrorCode, @@ -256,6 +255,7 @@ import { runIntegrationTest, runIntegrationTest2, testPay, + waitTasksDone, waitTransactionState, waitUntilAllTransactionsFinal, waitUntilRefreshesDone, @@ -734,7 +734,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( }; // After initialization, task loop should run. - wex.taskScheduler.ensureRunning(); + await wex.taskScheduler.ensureRunning(); wex.ws.initCalled = true; return resp; @@ -1325,6 +1325,10 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( }); return {}; } + case WalletApiOperation.TestingWaitTasksDone: { + await waitTasksDone(wex); + return {}; + } case WalletApiOperation.RemoveGlobalCurrencyAuditor: { const req = codecForRemoveGlobalCurrencyAuditorRequest().decode(payload); await wex.db.runReadWriteTx(["globalCurrencyAuditors"], async (tx) => { @@ -1394,7 +1398,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( case WalletApiOperation.TestingSetTimetravel: { const req = codecForTestingSetTimetravelRequest().decode(payload); setDangerousTimetravel(req.offsetMs); - wex.taskScheduler.reload(); + await wex.taskScheduler.reload(); return {}; } case WalletApiOperation.DeleteExchange: { @@ -1656,11 +1660,6 @@ export class Wallet { this.ws.stop(); } - async runTaskLoop(opts?: RetryLoopOpts): Promise<void> { - await this.ws.ensureWalletDbOpen(); - return this.ws.taskScheduler.run(opts); - } - async handleCoreApiRequest( operation: string, id: string, |