diff options
author | Sebastian <sebasjm@gmail.com> | 2023-11-10 11:51:03 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-11-10 11:51:03 -0300 |
commit | f73cbe71cdb4c490a4d8bd495d159e1f56488988 (patch) | |
tree | c3c5779a122daef918cdf575d75836b0b6a6041e /packages/taler-wallet-core/src | |
parent | bba84c52d6e3f14fce05f2d8316c09aaf7379753 (diff) | |
download | wallet-core-f73cbe71cdb4c490a4d8bd495d159e1f56488988.tar.xz |
kyc operation don't give lifeness
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pending.ts | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts index 49dcbd5a6..7641dcf33 100644 --- a/packages/taler-wallet-core/src/operations/pending.ts +++ b/packages/taler-wallet-core/src/operations/pending.ts @@ -234,6 +234,11 @@ async function gatherWithdrawalPending( await iterRecordsForWithdrawal(tx, { onlyState: "nonfinal" }, async (wsr) => { const opTag = TaskIdentifiers.forWithdrawal(wsr); let opr = await tx.operationRetries.get(opTag); + /** + * kyc pending operation don't give lifeness + * since the user need to complete kyc procedure + */ + const userNeedToCompleteKYC = wsr.kycUrl !== undefined const now = AbsoluteTime.now(); if (!opr) { opr = { @@ -251,9 +256,9 @@ async function gatherWithdrawalPending( ws, opTag, timestampOptionalAbsoluteFromDb(opr.retryInfo?.nextRetry) ?? - AbsoluteTime.now(), + AbsoluteTime.now(), ), - givesLifeness: true, + givesLifeness: !userNeedToCompleteKYC, withdrawalGroupId: wsr.withdrawalGroupId, lastError: opr.lastError, retryInfo: opr.retryInfo, @@ -301,6 +306,11 @@ async function gatherDepositPending( deposited = false; } } + /** + * kyc pending operation don't give lifeness + * since the user need to complete kyc procedure + */ + const userNeedToCompleteKYC = dg.kycInfo !== undefined const opId = TaskIdentifiers.forDeposit(dg); const retryRecord = await tx.operationRetries.get(opId); const timestampDue = @@ -312,7 +322,7 @@ async function gatherDepositPending( // Fully deposited operations don't give lifeness, // because there is no reason to wait on the // deposit tracking status. - givesLifeness: !deposited, + givesLifeness: !deposited && !userNeedToCompleteKYC, depositGroupId: dg.depositGroupId, lastError: retryRecord?.lastError, retryInfo: retryRecord?.retryInfo, @@ -353,6 +363,13 @@ async function gatherRewardPending( const timestampDue = timestampOptionalAbsoluteFromDb(retryRecord?.retryInfo.nextRetry) ?? AbsoluteTime.now(); + + /** + * kyc pending operation don't give lifeness + * since the user need to complete kyc procedure + */ + // const userNeedToCompleteKYC = tip. + if (tip.acceptedTimestamp) { resp.pendingOperations.push({ type: PendingTaskType.RewardPickup, @@ -532,10 +549,17 @@ async function gatherPeerPullInitiationPending( const timestampDue = timestampOptionalAbsoluteFromDb(retryRecord?.retryInfo.nextRetry) ?? AbsoluteTime.now(); + + /** + * kyc pending operation don't give lifeness + * since the user need to complete kyc procedure + */ + const userNeedToCompleteKYC = pi.kycUrl !== undefined + resp.pendingOperations.push({ type: PendingTaskType.PeerPullCredit, ...getPendingCommon(ws, opId, timestampDue), - givesLifeness: true, + givesLifeness: !userNeedToCompleteKYC, retryInfo: retryRecord?.retryInfo, pursePub: pi.pursePub, internalOperationStatus: `0x${pi.status.toString(16)}`, @@ -683,10 +707,17 @@ async function gatherPeerPushCreditPending( const timestampDue = timestampOptionalAbsoluteFromDb(retryRecord?.retryInfo.nextRetry) ?? AbsoluteTime.now(); + + /** + * kyc pending operation don't give lifeness + * since the user need to complete kyc procedure + */ + const userNeedToCompleteKYC = pi.kycUrl !== undefined + resp.pendingOperations.push({ type: PendingTaskType.PeerPushCredit, ...getPendingCommon(ws, opId, timestampDue), - givesLifeness: true, + givesLifeness: !userNeedToCompleteKYC, retryInfo: retryRecord?.retryInfo, peerPushCreditId: pi.peerPushCreditId, }); |