aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/transactions.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-09-08 12:54:31 +0200
committerFlorian Dold <florian@dold.me>2023-09-08 12:54:37 +0200
commit2ae952cdfa8f38a650be8e4438c21bace2f24c19 (patch)
tree2d4b8ec564102f750eb5b1e593bc13a0bdda1d5e /packages/taler-wallet-core/src/operations/transactions.ts
parent50b0b324ae67bea01079d6e9a1d684795f5b430f (diff)
wallet-core: remove redundant deposit status field in DB
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index 8db68e0f1..9d5ca9f1a 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -791,8 +791,8 @@ function buildTransactionForDeposit(
ort?: OperationRetryRecord,
): Transaction {
let deposited = true;
- for (const d of dg.depositedPerCoin) {
- if (!d) {
+ for (const d of dg.statusPerCoin) {
+ if (d == DepositElementStatus.DepositPending) {
deposited = false;
}
}
@@ -801,7 +801,7 @@ function buildTransactionForDeposit(
type: TransactionType.Deposit,
txState: computeDepositTransactionStatus(dg),
txActions: computeDepositTransactionActions(dg),
- amountRaw: Amounts.stringify(dg.effectiveDepositAmount),
+ amountRaw: Amounts.stringify(dg.counterpartyEffectiveDepositAmount),
amountEffective: Amounts.stringify(dg.totalPayCost),
timestamp: dg.timestampCreated,
targetPaytoUri: dg.wire.payto_uri,
@@ -812,11 +812,11 @@ function buildTransactionForDeposit(
}),
wireTransferProgress:
(100 *
- dg.transactionPerCoin.reduce(
+ dg.statusPerCoin.reduce(
(prev, cur) => prev + (cur === DepositElementStatus.Wired ? 1 : 0),
0,
)) /
- dg.transactionPerCoin.length,
+ dg.statusPerCoin.length,
depositGroupId: dg.depositGroupId,
trackingState: Object.values(dg.trackingState ?? {}),
deposited,