aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-01-08 15:03:15 +0100
committerFlorian Dold <florian@dold.me>2024-01-08 15:03:15 +0100
commit35cbcce79e22d7c3cd9ac1c676ad9b3480bd3fe1 (patch)
tree2f50a6a60797e0533c5e3eb9f4c85095a278bf4e /packages/taler-wallet-core
parent82cea86785fc9ab6aa5440cc077e8f2024b33c13 (diff)
downloadwallet-core-35cbcce79e22d7c3cd9ac1c676ad9b3480bd3fe1.tar.xz
wallet-core: fix query for nonfinal payment transactions
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/db.ts10
-rw-r--r--packages/taler-wallet-core/src/operations/pending.ts6
2 files changed, 14 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts
index 6f6aad256..d13e30cc6 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -255,6 +255,16 @@ export function timestampOptionalAbsoluteFromDb(
*/
/**
+ * First possible operation status in the active range (inclusive).
+ */
+export const OPERATION_STATUS_ACTIVE_FIRST = 0x0100_0000;
+
+/**
+ * LAST possible operation status in the active range (inclusive).
+ */
+export const OPERATION_STATUS_ACTIVE_LAST = 0x0113_FFFF;
+
+/**
* Status of a withdrawal.
*/
export enum WithdrawalGroupStatus {
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts
index 76b9fd801..560031ad1 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -34,6 +34,8 @@ import {
DepositElementStatus,
DepositGroupRecord,
ExchangeEntryDbUpdateStatus,
+ OPERATION_STATUS_ACTIVE_FIRST,
+ OPERATION_STATUS_ACTIVE_LAST,
PeerPullCreditRecord,
PeerPullDebitRecordStatus,
PeerPullPaymentCreditStatus,
@@ -418,8 +420,8 @@ export async function iterRecordsForPurchase(
): Promise<void> {
if (filter.onlyState === "nonfinal") {
const keyRange = GlobalIDB.KeyRange.bound(
- PurchaseStatus.PendingDownloadingProposal,
- PurchaseStatus.PendingAcceptRefund,
+ OPERATION_STATUS_ACTIVE_FIRST,
+ OPERATION_STATUS_ACTIVE_LAST,
);
await tx.purchases.indexes.byStatus.iter(keyRange).forEachAsync(f);
} else {