diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 1a511583a..674d4959c 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -68,7 +68,7 @@ import { import { InternalWalletState } from "../internal-wallet-state.js"; import { PendingTaskType } from "../pending-types.js"; import { assertUnreachable } from "../util/assertUnreachable.js"; -import { checkDbInvariant } from "../util/invariants.js"; +import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js"; import { constructTaskIdentifier, TaskIdentifiers } from "../util/retries.js"; import { makeTombstoneId, @@ -92,7 +92,7 @@ import { } from "./pay-merchant.js"; import { processPeerPullCredit } from "./pay-peer.js"; import { processRefreshGroup } from "./refresh.js"; -import { processTip } from "./tip.js"; +import { computeTipTransactionStatus, processTip } from "./tip.js"; import { augmentPaytoUrisForWithdrawal, processWithdrawalGroup, @@ -823,11 +823,11 @@ function buildTransactionForTip( tipRecord: TipRecord, ort?: OperationRetryRecord, ): Transaction { - if (!tipRecord.acceptedTimestamp) throw Error(""); + checkLogicInvariant(!!tipRecord.acceptedTimestamp); return { type: TransactionType.Tip, - txState: mkTxStateUnknown(), + txState: computeTipTransactionStatus(tipRecord), amountEffective: Amounts.stringify(tipRecord.tipAmountEffective), amountRaw: Amounts.stringify(tipRecord.tipAmountRaw), extendedStatus: tipRecord.pickedUpTimestamp |