diff options
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-pull-debit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-pull-debit.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts index 114d2366a..6cc552714 100644 --- a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts +++ b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts @@ -71,7 +71,7 @@ import { TaskRunResult, TaskRunResultType, TransactionContext, - TransitionResult, + TransitionResultType, constructTaskIdentifier, spendCoins, } from "./common.js"; @@ -192,17 +192,17 @@ export class PeerPullDebitTransactionContext implements TransactionContext { switch (pi.status) { case PeerPullDebitRecordStatus.SuspendedDeposit: pi.status = PeerPullDebitRecordStatus.PendingDeposit; - return TransitionResult.Transition; + return TransitionResultType.Transition; case PeerPullDebitRecordStatus.SuspendedAbortingRefresh: pi.status = PeerPullDebitRecordStatus.AbortingRefresh; - return TransitionResult.Transition; + return TransitionResultType.Transition; case PeerPullDebitRecordStatus.Aborted: case PeerPullDebitRecordStatus.AbortingRefresh: case PeerPullDebitRecordStatus.Failed: case PeerPullDebitRecordStatus.DialogProposed: case PeerPullDebitRecordStatus.Done: case PeerPullDebitRecordStatus.PendingDeposit: - return TransitionResult.Stay; + return TransitionResultType.Stay; } }); this.wex.taskScheduler.startShepherdTask(this.taskId); @@ -218,9 +218,9 @@ export class PeerPullDebitTransactionContext implements TransactionContext { case PeerPullDebitRecordStatus.SuspendedAbortingRefresh: // FIXME: Should we also abort the corresponding refresh session?! pi.status = PeerPullDebitRecordStatus.Failed; - return TransitionResult.Transition; + return TransitionResultType.Transition; default: - return TransitionResult.Stay; + return TransitionResultType.Stay; } }); this.wex.taskScheduler.stopShepherdTask(this.taskId); @@ -244,7 +244,7 @@ export class PeerPullDebitTransactionContext implements TransactionContext { case PeerPullDebitRecordStatus.PendingDeposit: break; default: - return TransitionResult.Stay; + return TransitionResultType.Stay; } const currency = Amounts.currencyOf(pi.totalCostEstimated); const coinPubs: CoinRefreshRequest[] = []; @@ -271,13 +271,13 @@ export class PeerPullDebitTransactionContext implements TransactionContext { pi.status = PeerPullDebitRecordStatus.AbortingRefresh; pi.abortRefreshGroupId = refresh.refreshGroupId; - return TransitionResult.Transition; + return TransitionResultType.Transition; }, ); } async transition( - f: (rec: PeerPullPaymentIncomingRecord) => Promise<TransitionResult>, + f: (rec: PeerPullPaymentIncomingRecord) => Promise<TransitionResultType>, ): Promise<void> { return this.transitionExtra( { @@ -297,7 +297,7 @@ export class PeerPullDebitTransactionContext implements TransactionContext { typeof WalletStoresV1, ["peerPullDebit", ...StoreNameArray] >, - ) => Promise<TransitionResult>, + ) => Promise<TransitionResultType>, ): Promise<void> { const wex = this.wex; const extraStores = opts.extraStores ?? []; @@ -311,7 +311,7 @@ export class PeerPullDebitTransactionContext implements TransactionContext { const oldTxState = computePeerPullDebitTransactionState(pi); const res = await f(pi, tx); switch (res) { - case TransitionResult.Transition: { + case TransitionResultType.Transition: { await tx.peerPullDebit.put(pi); const newTxState = computePeerPullDebitTransactionState(pi); return { @@ -460,10 +460,10 @@ async function processPeerPullDebitPendingDeposit( await ctx.transition(async (r) => { if (r.status !== PeerPullDebitRecordStatus.PendingDeposit) { - return TransitionResult.Stay; + return TransitionResultType.Stay; } r.status = PeerPullDebitRecordStatus.Done; - return TransitionResult.Transition; + return TransitionResultType.Transition; }); return TaskRunResult.finished(); } |