aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pending.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pending.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pending.ts21
1 files changed, 7 insertions, 14 deletions
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts
index 207e6ffda..6115f848b 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -46,6 +46,7 @@ import {
RefundGroupStatus,
ExchangeEntryDbUpdateStatus,
RefreshOperationStatus,
+ DepositElementStatus,
} from "../db.js";
import {
PendingOperationsResponse,
@@ -277,8 +278,8 @@ async function gatherDepositPending(
): Promise<void> {
await iterRecordsForDeposit(tx, { onlyState: "nonfinal" }, async (dg) => {
let deposited = true;
- for (const d of dg.depositedPerCoin) {
- if (!d) {
+ for (const d of dg.statusPerCoin) {
+ if (d === DepositElementStatus.DepositPending) {
deposited = false;
}
}
@@ -480,9 +481,7 @@ export async function iterRecordsForPeerPullInitiation(
PeerPullPaymentCreditStatus.PendingCreatePurse,
PeerPullPaymentCreditStatus.AbortingDeletePurse,
);
- await tx.peerPullCredit.indexes.byStatus
- .iter(keyRange)
- .forEachAsync(f);
+ await tx.peerPullCredit.indexes.byStatus.iter(keyRange).forEachAsync(f);
} else {
await tx.peerPullCredit.indexes.byStatus.iter().forEachAsync(f);
}
@@ -528,9 +527,7 @@ export async function iterRecordsForPeerPullDebit(
PeerPullDebitRecordStatus.PendingDeposit,
PeerPullDebitRecordStatus.AbortingRefresh,
);
- await tx.peerPullDebit.indexes.byStatus
- .iter(keyRange)
- .forEachAsync(f);
+ await tx.peerPullDebit.indexes.byStatus.iter(keyRange).forEachAsync(f);
} else {
await tx.peerPullDebit.indexes.byStatus.iter().forEachAsync(f);
}
@@ -576,9 +573,7 @@ export async function iterRecordsForPeerPushInitiation(
PeerPushDebitStatus.PendingCreatePurse,
PeerPushDebitStatus.AbortingRefresh,
);
- await tx.peerPushDebit.indexes.byStatus
- .iter(keyRange)
- .forEachAsync(f);
+ await tx.peerPushDebit.indexes.byStatus.iter(keyRange).forEachAsync(f);
} else {
await tx.peerPushDebit.indexes.byStatus.iter().forEachAsync(f);
}
@@ -624,9 +619,7 @@ export async function iterRecordsForPeerPushCredit(
PeerPushCreditStatus.PendingMerge,
PeerPushCreditStatus.PendingWithdrawing,
);
- await tx.peerPushCredit.indexes.byStatus
- .iter(keyRange)
- .forEachAsync(f);
+ await tx.peerPushCredit.indexes.byStatus.iter(keyRange).forEachAsync(f);
} else {
await tx.peerPushCredit.indexes.byStatus.iter().forEachAsync(f);
}