diff options
author | Florian Dold <florian@dold.me> | 2023-09-14 17:36:15 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-14 19:18:01 +0200 |
commit | 1ce53e1c211296233f2f683c64e156e4d3a79678 (patch) | |
tree | b6af47e4c77d5a0321ccaf3035040def0fcc64a9 /packages/taler-wallet-core/src/operations/transactions.ts | |
parent | f4587c44fd6a6d76384cd671550890255c3fe650 (diff) |
wallet-core: consistently use usec timestamps in DB
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 41bdae249..cf2006406 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -20,6 +20,7 @@ import { AbsoluteTime, Amounts, + DepositTransactionTrackingState, j2s, Logger, NotificationType, @@ -69,6 +70,7 @@ import { GetReadOnlyAccess, timestampOptionalPreciseFromDb, timestampPreciseFromDb, + timestampProtocolFromDb, WalletStoresV1, } from "../index.js"; import { InternalWalletState } from "../internal-wallet-state.js"; @@ -809,6 +811,17 @@ function buildTransactionForDeposit( } } + const trackingState: DepositTransactionTrackingState[] = []; + + for (const ts of Object.values(dg.trackingState ?? {})) { + trackingState.push({ + amountRaw: ts.amountRaw, + timestampExecuted: timestampProtocolFromDb(ts.timestampExecuted), + wireFee: ts.wireFee, + wireTransferId: ts.wireTransferId, + }); + } + return { type: TransactionType.Deposit, txState: computeDepositTransactionStatus(dg), @@ -817,7 +830,7 @@ function buildTransactionForDeposit( amountEffective: Amounts.stringify(dg.totalPayCost), timestamp: timestampPreciseFromDb(dg.timestampCreated), targetPaytoUri: dg.wire.payto_uri, - wireTransferDeadline: dg.wireTransferDeadline, + wireTransferDeadline: timestampProtocolFromDb(dg.wireTransferDeadline), transactionId: constructTransactionIdentifier({ tag: TransactionType.Deposit, depositGroupId: dg.depositGroupId, @@ -830,7 +843,7 @@ function buildTransactionForDeposit( )) / dg.statusPerCoin.length, depositGroupId: dg.depositGroupId, - trackingState: Object.values(dg.trackingState ?? {}), + trackingState, deposited, ...(ort?.lastError ? { error: ort.lastError } : {}), }; |