diff options
author | Florian Dold <florian@dold.me> | 2024-03-13 21:07:46 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-27 13:06:15 +0100 |
commit | 6b9b4ba7cc1576e7cc91e2b30e9d5e75edbe0037 (patch) | |
tree | da139f91fb7cf7402420bd50cacae8e369dcf28a /packages/taler-wallet-core/src/pay-merchant.ts | |
parent | 237c4e8adae997e84f5fb7a8fe5c03b1148e99dc (diff) | |
download | wallet-core-6b9b4ba7cc1576e7cc91e2b30e9d5e75edbe0037.tar.gz wallet-core-6b9b4ba7cc1576e7cc91e2b30e9d5e75edbe0037.tar.bz2 wallet-core-6b9b4ba7cc1576e7cc91e2b30e9d5e75edbe0037.zip |
wallet-core: preparations for materialzed txnsdev/dold/materialized-transactions
Diffstat (limited to 'packages/taler-wallet-core/src/pay-merchant.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-merchant.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts index 401020f47..40abd44a0 100644 --- a/packages/taler-wallet-core/src/pay-merchant.ts +++ b/packages/taler-wallet-core/src/pay-merchant.ts @@ -106,7 +106,7 @@ import { TaskRunResultType, TombstoneTag, TransactionContext, - TransitionResult, + TransitionResultType, } from "./common.js"; import { EddsaKeypair } from "./crypto/cryptoImplementation.js"; import { @@ -172,7 +172,7 @@ export class PayMerchantTransactionContext implements TransactionContext { * Transition a payment transition. */ async transition( - f: (rec: PurchaseRecord) => Promise<TransitionResult>, + f: (rec: PurchaseRecord) => Promise<TransitionResultType>, ): Promise<void> { return this.transitionExtra( { @@ -196,7 +196,7 @@ export class PayMerchantTransactionContext implements TransactionContext { typeof WalletStoresV1, ["purchases", ...StoreNameArray] >, - ) => Promise<TransitionResult>, + ) => Promise<TransitionResultType>, ): Promise<void> { const ws = this.wex; const extraStores = opts.extraStores ?? []; @@ -210,7 +210,7 @@ export class PayMerchantTransactionContext implements TransactionContext { const oldTxState = computePayMerchantTransactionState(purchaseRec); const res = await f(purchaseRec, tx); switch (res) { - case TransitionResult.Transition: { + case TransitionResultType.Transition: { await tx.purchases.put(purchaseRec); const newTxState = computePayMerchantTransactionState(purchaseRec); return { @@ -2746,9 +2746,9 @@ async function processPurchaseAbortingRefund( await ctx.transition(async (rec) => { if (rec.purchaseStatus === PurchaseStatus.AbortingWithRefund) { rec.purchaseStatus = PurchaseStatus.AbortedOrderDeleted; - return TransitionResult.Transition; + return TransitionResultType.Transition; } - return TransitionResult.Stay; + return TransitionResultType.Stay; }); } } |