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.ts23
1 files changed, 9 insertions, 14 deletions
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts
index 7641dcf33..282f84ad7 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -49,10 +49,12 @@ import {
WalletStoresV1,
WithdrawalGroupRecord,
WithdrawalGroupStatus,
+ depositOperationNonfinalStatusRange,
timestampAbsoluteFromDb,
timestampOptionalAbsoluteFromDb,
timestampPreciseFromDb,
timestampPreciseToDb,
+ withdrawalGroupNonfinalRange,
} from "../db.js";
import { InternalWalletState } from "../internal-wallet-state.js";
import {
@@ -205,12 +207,8 @@ export async function iterRecordsForWithdrawal(
): Promise<void> {
let withdrawalGroupRecords: WithdrawalGroupRecord[];
if (filter.onlyState === "nonfinal") {
- const range = GlobalIDB.KeyRange.bound(
- WithdrawalGroupStatus.PendingRegisteringBank,
- WithdrawalGroupStatus.PendingAml,
- );
withdrawalGroupRecords = await tx.withdrawalGroups.indexes.byStatus.getAll(
- range,
+ withdrawalGroupNonfinalRange,
);
} else {
withdrawalGroupRecords =
@@ -238,7 +236,7 @@ async function gatherWithdrawalPending(
* kyc pending operation don't give lifeness
* since the user need to complete kyc procedure
*/
- const userNeedToCompleteKYC = wsr.kycUrl !== undefined
+ const userNeedToCompleteKYC = wsr.kycUrl !== undefined;
const now = AbsoluteTime.now();
if (!opr) {
opr = {
@@ -256,7 +254,7 @@ async function gatherWithdrawalPending(
ws,
opTag,
timestampOptionalAbsoluteFromDb(opr.retryInfo?.nextRetry) ??
- AbsoluteTime.now(),
+ AbsoluteTime.now(),
),
givesLifeness: !userNeedToCompleteKYC,
withdrawalGroupId: wsr.withdrawalGroupId,
@@ -276,10 +274,7 @@ export async function iterRecordsForDeposit(
let dgs: DepositGroupRecord[];
if (filter.onlyState === "nonfinal") {
dgs = await tx.depositGroups.indexes.byStatus.getAll(
- GlobalIDB.KeyRange.bound(
- DepositOperationStatus.PendingDeposit,
- DepositOperationStatus.PendingKyc,
- ),
+ depositOperationNonfinalStatusRange,
);
} else {
dgs = await tx.depositGroups.indexes.byStatus.getAll();
@@ -310,7 +305,7 @@ async function gatherDepositPending(
* kyc pending operation don't give lifeness
* since the user need to complete kyc procedure
*/
- const userNeedToCompleteKYC = dg.kycInfo !== undefined
+ const userNeedToCompleteKYC = dg.kycInfo !== undefined;
const opId = TaskIdentifiers.forDeposit(dg);
const retryRecord = await tx.operationRetries.get(opId);
const timestampDue =
@@ -554,7 +549,7 @@ async function gatherPeerPullInitiationPending(
* kyc pending operation don't give lifeness
* since the user need to complete kyc procedure
*/
- const userNeedToCompleteKYC = pi.kycUrl !== undefined
+ const userNeedToCompleteKYC = pi.kycUrl !== undefined;
resp.pendingOperations.push({
type: PendingTaskType.PeerPullCredit,
@@ -712,7 +707,7 @@ async function gatherPeerPushCreditPending(
* kyc pending operation don't give lifeness
* since the user need to complete kyc procedure
*/
- const userNeedToCompleteKYC = pi.kycUrl !== undefined
+ const userNeedToCompleteKYC = pi.kycUrl !== undefined;
resp.pendingOperations.push({
type: PendingTaskType.PeerPushCredit,