From 598de5b0d576987ea317b22fd6d33cbe4a1a19ac Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 18 Jan 2023 19:30:48 +0100 Subject: wallet-core: Add 'deposited' field to deposit transaction This field indicates whether the POST requests to deposit coins went through with the exchange. We also don't consider a deposit transaction as having lifeness when it is already deposited and we're just querying for informational deposit tracking information. --- packages/taler-wallet-core/src/operations/transactions.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages/taler-wallet-core/src/operations/transactions.ts') diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 58def0f34..7fa2c075c 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -557,6 +557,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), @@ -581,6 +587,7 @@ function buildTransactionForDeposit( )) / dg.transactionPerCoin.length, depositGroupId: dg.depositGroupId, + deposited, ...(ort?.lastError ? { error: ort.lastError } : {}), }; } -- cgit v1.2.3