diff options
author | Florian Dold <florian@dold.me> | 2023-09-08 12:54:31 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-08 12:54:37 +0200 |
commit | 2ae952cdfa8f38a650be8e4438c21bace2f24c19 (patch) | |
tree | 2d4b8ec564102f750eb5b1e593bc13a0bdda1d5e /packages/taler-wallet-core/src/operations/pending.ts | |
parent | 50b0b324ae67bea01079d6e9a1d684795f5b430f (diff) |
wallet-core: remove redundant deposit status field in DB
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pending.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pending.ts | 21 |
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); } |