diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-18 17:32:34 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-18 17:32:34 -0300 |
commit | fdc7b5827742f6c692d4c8c1431b9042e67b748c (patch) | |
tree | 6a687f0aa55cce257e587f26f167239d46ca5df4 /packages/taler-wallet-core/src/operations | |
parent | 4bd9b1ba79af12d5916e0ab308acd40935a813ec (diff) | |
parent | d7fe5b0cb5472becfafa7123f880d26d8efd2f8f (diff) | |
download | wallet-core-fdc7b5827742f6c692d4c8c1431b9042e67b748c.tar.xz |
Merge branch 'master' of git.taler.net:wallet-core
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
4 files changed, 24 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts index 71caae5b3..f3ec81686 100644 --- a/packages/taler-wallet-core/src/operations/deposits.ts +++ b/packages/taler-wallet-core/src/operations/deposits.ts @@ -21,7 +21,6 @@ import { AbsoluteTime, AmountJson, Amounts, - bytesToString, CancellationToken, canonicalJson, codecForDepositSuccess, @@ -457,6 +456,8 @@ export async function prepareDepositGroup( effectiveDepositAmount: Amounts.stringify(effectiveDepositAmount), }; } + + export async function createDepositGroup( ws: InternalWalletState, req: CreateDepositGroupRequest, diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts index d9d62ec65..a73af528c 100644 --- a/packages/taler-wallet-core/src/operations/pending.ts +++ b/packages/taler-wallet-core/src/operations/pending.ts @@ -200,13 +200,22 @@ async function gatherDepositPending( if (dg.timestampFinished) { return; } + let deposited = true; + for (const d of dg.depositedPerCoin) { + if (!d) { + deposited = false; + } + } const opId = RetryTags.forDeposit(dg); const retryRecord = await tx.operationRetries.get(opId); const timestampDue = retryRecord?.retryInfo.nextRetry ?? AbsoluteTime.now(); resp.pendingOperations.push({ type: PendingTaskType.Deposit, ...getPendingCommon(ws, opId, timestampDue), - givesLifeness: true, + // Fully deposited operations don't give lifeness, + // because there is no reason to wait on the + // deposit tracking status. + givesLifeness: !deposited, depositGroupId: dg.depositGroupId, lastError: retryRecord?.lastError, retryInfo: retryRecord?.retryInfo, diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index b94617851..083b6618a 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -559,6 +559,12 @@ function buildTransactionForDeposit( dg: DepositGroupRecord, ort?: OperationRetryRecord, ): Transaction { + let deposited = true; + for (const d of dg.depositedPerCoin) { + if (!d) { + deposited = false; + } + } return { type: TransactionType.Deposit, amountRaw: Amounts.stringify(dg.effectiveDepositAmount), @@ -583,6 +589,7 @@ function buildTransactionForDeposit( )) / dg.transactionPerCoin.length, depositGroupId: dg.depositGroupId, + deposited, ...(ort?.lastError ? { error: ort.lastError } : {}), }; } diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 7c6228530..f7edfed91 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -933,12 +933,17 @@ async function queryReserve( cancellationToken, }); + logger.info(`reserve status code: HTTP ${resp.status}`); + const result = await readSuccessResponseJsonOrErrorCode( resp, codecForReserveStatus(), ); if (result.isError) { + logger.info( + `got reserve status error, EC=${result.talerErrorResponse.code}`, + ); if ( resp.status === 404 && result.talerErrorResponse.code === |