wallet-core: dispatch cancelAborting for withdrawal
This commit is contained in:
parent
5b665c7d80
commit
5df212c66d
@ -106,6 +106,7 @@ import { computeTipTransactionStatus, processTip } from "./tip.js";
|
|||||||
import {
|
import {
|
||||||
abortWithdrawalTransaction,
|
abortWithdrawalTransaction,
|
||||||
augmentPaytoUrisForWithdrawal,
|
augmentPaytoUrisForWithdrawal,
|
||||||
|
cancelAbortingWithdrawalTransaction,
|
||||||
computeWithdrawalTransactionStatus,
|
computeWithdrawalTransactionStatus,
|
||||||
processWithdrawalGroup,
|
processWithdrawalGroup,
|
||||||
} from "./withdraw.js";
|
} from "./withdraw.js";
|
||||||
@ -1415,6 +1416,9 @@ export async function cancelAbortingTransaction(
|
|||||||
case TransactionType.Deposit:
|
case TransactionType.Deposit:
|
||||||
await cancelAbortingDepositGroup(ws, tx.depositGroupId);
|
await cancelAbortingDepositGroup(ws, tx.depositGroupId);
|
||||||
return;
|
return;
|
||||||
|
case TransactionType.Withdrawal:
|
||||||
|
await cancelAbortingWithdrawalTransaction(ws, tx.withdrawalGroupId);
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
logger.warn(`unable to suspend transaction of type '${tx.tag}'`);
|
logger.warn(`unable to suspend transaction of type '${tx.tag}'`);
|
||||||
}
|
}
|
||||||
|
@ -339,8 +339,6 @@ export async function abortWithdrawalTransaction(
|
|||||||
notifyTransition(ws, transactionId, transitionInfo);
|
notifyTransition(ws, transactionId, transitionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called "cancel" in the spec right now,
|
|
||||||
// from suspended-aborting.
|
|
||||||
export async function cancelAbortingWithdrawalTransaction(
|
export async function cancelAbortingWithdrawalTransaction(
|
||||||
ws: InternalWalletState,
|
ws: InternalWalletState,
|
||||||
withdrawalGroupId: string,
|
withdrawalGroupId: string,
|
||||||
@ -364,6 +362,7 @@ export async function cancelAbortingWithdrawalTransaction(
|
|||||||
}
|
}
|
||||||
let newStatus: WithdrawalGroupStatus | undefined = undefined;
|
let newStatus: WithdrawalGroupStatus | undefined = undefined;
|
||||||
switch (wg.status) {
|
switch (wg.status) {
|
||||||
|
case WithdrawalGroupStatus.SuspendedAbortingBank:
|
||||||
case WithdrawalGroupStatus.AbortingBank:
|
case WithdrawalGroupStatus.AbortingBank:
|
||||||
newStatus = WithdrawalGroupStatus.FailedAbortingBank;
|
newStatus = WithdrawalGroupStatus.FailedAbortingBank;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user