diff options
author | Florian Dold <florian@dold.me> | 2024-06-13 18:19:20 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-13 18:22:23 +0200 |
commit | 10aa5e767a35d39d6612f5e4addf4e04f3241a42 (patch) | |
tree | 70d62dbbe02a9257e0af988a09de8cc0ee9ba557 /packages/taler-wallet-core/src/transactions.ts | |
parent | 955b957ef6d7d27d444d363cf80ea8942233f97c (diff) | |
download | wallet-core-10aa5e767a35d39d6612f5e4addf4e04f3241a42.tar.xz |
wallet-core: introduce coin history store, spend coins transactionally
Diffstat (limited to 'packages/taler-wallet-core/src/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/transactions.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/transactions.ts b/packages/taler-wallet-core/src/transactions.ts index 7782d09ba..7f766f1b0 100644 --- a/packages/taler-wallet-core/src/transactions.ts +++ b/packages/taler-wallet-core/src/transactions.ts @@ -99,7 +99,7 @@ import { computePayMerchantTransactionActions, computePayMerchantTransactionState, computeRefundTransactionState, - expectProposalDownload, + expectProposalDownloadInTx, extractContractData, PayMerchantTransactionContext, RefundTransactionContext, @@ -306,7 +306,7 @@ export async function getTransactionById( async (tx) => { const purchase = await tx.purchases.get(proposalId); if (!purchase) throw Error("not found"); - const download = await expectProposalDownload(wex, purchase, tx); + const download = await expectProposalDownloadInTx(wex, tx, purchase); const contractData = download.contractData; const payOpId = TaskIdentifiers.forPay(purchase); const payRetryRecord = await tx.operationRetries.get(payOpId); @@ -744,7 +744,10 @@ function buildTransactionForBankIntegratedWithdraw( ? undefined : Amounts.currencyOf(wg.instructedAmount); const currency = wg.wgInfo.bankInfo.currency ?? instructedCurrency; - checkDbInvariant(currency !== undefined, "wg uninitialized (missing currency)"); + checkDbInvariant( + currency !== undefined, + "wg uninitialized (missing currency)", + ); const txState = computeWithdrawalTransactionStatus(wg); const zero = Amounts.stringify(Amounts.zeroOfCurrency(currency)); |