From 7d6bcd42ea9efced6200cf94924aa38bed2dbb02 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 21 Sep 2022 20:46:45 +0200 Subject: wallet-core: use numeric status field to allow range queries --- packages/taler-wallet-core/src/operations/pending.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-core/src/operations/pending.ts') diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts index 9ba532ab7..18e8ec83b 100644 --- a/packages/taler-wallet-core/src/operations/pending.ts +++ b/packages/taler-wallet-core/src/operations/pending.ts @@ -28,6 +28,9 @@ import { BackupProviderStateTag, RefreshCoinStatus, OperationStatus, + WithdrawalGroupRecord, + WithdrawalGroupStatus, + OperationStatusRange, } from "../db.js"; import { PendingOperationsResponse, @@ -38,6 +41,7 @@ import { InternalWalletState } from "../internal-wallet-state.js"; import { GetReadOnlyAccess } from "../util/query.js"; import { RetryTags } from "../util/retries.js"; import { Wallet } from "../wallet.js"; +import { GlobalIDB } from "@gnu-taler/idb-bridge"; async function gatherExchangePending( tx: GetReadOnlyAccess<{ @@ -120,7 +124,10 @@ async function gatherWithdrawalPending( resp: PendingOperationsResponse, ): Promise { const wsrs = await tx.withdrawalGroups.indexes.byStatus.getAll( - OperationStatus.Pending, + GlobalIDB.KeyRange.bound( + OperationStatusRange.ACTIVE_START, + OperationStatusRange.ACTIVE_END, + ), ); for (const wsr of wsrs) { if (wsr.timestampFinish) { -- cgit v1.2.3