wallet-core: consistently rename to failTransaction
This commit is contained in:
parent
32937795c5
commit
8d20ab87fa
@ -1920,15 +1920,15 @@ export const codecForAcceptTipRequest = (): Codec<AcceptTipRequest> =>
|
|||||||
.property("walletTipId", codecForString())
|
.property("walletTipId", codecForString())
|
||||||
.build("AcceptTipRequest");
|
.build("AcceptTipRequest");
|
||||||
|
|
||||||
export interface CancelAbortingTransactionRequest {
|
export interface FailTransactionRequest {
|
||||||
transactionId: TransactionIdStr;
|
transactionId: TransactionIdStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const codecForCancelAbortingTransactionRequest =
|
export const codecForFailTransactionRequest =
|
||||||
(): Codec<CancelAbortingTransactionRequest> =>
|
(): Codec<FailTransactionRequest> =>
|
||||||
buildCodecForObject<CancelAbortingTransactionRequest>()
|
buildCodecForObject<FailTransactionRequest>()
|
||||||
.property("transactionId", codecForTransactionIdStr())
|
.property("transactionId", codecForTransactionIdStr())
|
||||||
.build("CancelAbortingTransactionRequest");
|
.build("FailTransactionRequest");
|
||||||
|
|
||||||
export interface SuspendTransactionRequest {
|
export interface SuspendTransactionRequest {
|
||||||
transactionId: TransactionIdStr;
|
transactionId: TransactionIdStr;
|
||||||
@ -1953,7 +1953,7 @@ export interface AbortTransactionRequest {
|
|||||||
transactionId: TransactionIdStr;
|
transactionId: TransactionIdStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CancelAbortingTransactionRequest {
|
export interface FailTransactionRequest {
|
||||||
transactionId: TransactionIdStr;
|
transactionId: TransactionIdStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,17 +446,16 @@ transactionsCli
|
|||||||
});
|
});
|
||||||
|
|
||||||
transactionsCli
|
transactionsCli
|
||||||
.subcommand("cancelAbortingTransaction", "cancel-aborting", {
|
.subcommand("fail", "fail", {
|
||||||
help: "Cancel the attempt of properly aborting a transaction.",
|
help: "Fail a transaction (when it can't be aborted).",
|
||||||
})
|
})
|
||||||
.requiredArgument("transactionId", clk.STRING, {
|
.requiredArgument("transactionId", clk.STRING, {
|
||||||
help: "Identifier of the transaction to cancel aborting.",
|
help: "Identifier of the transaction to fail.",
|
||||||
})
|
})
|
||||||
.action(async (args) => {
|
.action(async (args) => {
|
||||||
await withWallet(args, async (wallet) => {
|
await withWallet(args, async (wallet) => {
|
||||||
await wallet.client.call(WalletApiOperation.CancelAbortingTransaction, {
|
await wallet.client.call(WalletApiOperation.FailTransaction, {
|
||||||
transactionId: args.cancelAbortingTransaction
|
transactionId: args.fail.transactionId as TransactionIdStr,
|
||||||
.transactionId as TransactionIdStr,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ import {
|
|||||||
ApplyDevExperimentRequest,
|
ApplyDevExperimentRequest,
|
||||||
BackupRecovery,
|
BackupRecovery,
|
||||||
BalancesResponse,
|
BalancesResponse,
|
||||||
CancelAbortingTransactionRequest,
|
FailTransactionRequest,
|
||||||
CheckPeerPullCreditRequest,
|
CheckPeerPullCreditRequest,
|
||||||
CheckPeerPullCreditResponse,
|
CheckPeerPullCreditResponse,
|
||||||
CheckPeerPushDebitRequest,
|
CheckPeerPushDebitRequest,
|
||||||
@ -166,9 +166,11 @@ export enum WalletApiOperation {
|
|||||||
GetExchangeDetailedInfo = "getExchangeDetailedInfo",
|
GetExchangeDetailedInfo = "getExchangeDetailedInfo",
|
||||||
RetryPendingNow = "retryPendingNow",
|
RetryPendingNow = "retryPendingNow",
|
||||||
AbortTransaction = "abortTransaction",
|
AbortTransaction = "abortTransaction",
|
||||||
CancelAbortingTransaction = "cancelAbortingTransaction",
|
FailTransaction = "failTransaction",
|
||||||
SuspendTransaction = "suspendTransaction",
|
SuspendTransaction = "suspendTransaction",
|
||||||
ResumeTransaction = "resumeTransaction",
|
ResumeTransaction = "resumeTransaction",
|
||||||
|
DeleteTransaction = "deleteTransaction",
|
||||||
|
RetryTransaction = "retryTransaction",
|
||||||
ConfirmPay = "confirmPay",
|
ConfirmPay = "confirmPay",
|
||||||
DumpCoins = "dumpCoins",
|
DumpCoins = "dumpCoins",
|
||||||
SetCoinSuspended = "setCoinSuspended",
|
SetCoinSuspended = "setCoinSuspended",
|
||||||
@ -184,8 +186,6 @@ export enum WalletApiOperation {
|
|||||||
GetBackupInfo = "getBackupInfo",
|
GetBackupInfo = "getBackupInfo",
|
||||||
PrepareDeposit = "prepareDeposit",
|
PrepareDeposit = "prepareDeposit",
|
||||||
GetVersion = "getVersion",
|
GetVersion = "getVersion",
|
||||||
DeleteTransaction = "deleteTransaction",
|
|
||||||
RetryTransaction = "retryTransaction",
|
|
||||||
ListCurrencies = "listCurrencies",
|
ListCurrencies = "listCurrencies",
|
||||||
GenerateDepositGroupTxId = "generateDepositGroupTxId",
|
GenerateDepositGroupTxId = "generateDepositGroupTxId",
|
||||||
CreateDepositGroup = "createDepositGroup",
|
CreateDepositGroup = "createDepositGroup",
|
||||||
@ -384,9 +384,9 @@ export type AbortTransactionOp = {
|
|||||||
*
|
*
|
||||||
* For payment transactions, it puts the payment into an "aborting" state.
|
* For payment transactions, it puts the payment into an "aborting" state.
|
||||||
*/
|
*/
|
||||||
export type CancelAbortingTransactionOp = {
|
export type FailTransactionOp = {
|
||||||
op: WalletApiOperation.CancelAbortingTransaction;
|
op: WalletApiOperation.FailTransaction;
|
||||||
request: CancelAbortingTransactionRequest;
|
request: FailTransactionRequest;
|
||||||
response: EmptyObject;
|
response: EmptyObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -979,7 +979,7 @@ export type WalletOperations = {
|
|||||||
[WalletApiOperation.WithdrawTestkudos]: WithdrawTestkudosOp;
|
[WalletApiOperation.WithdrawTestkudos]: WithdrawTestkudosOp;
|
||||||
[WalletApiOperation.ConfirmPay]: ConfirmPayOp;
|
[WalletApiOperation.ConfirmPay]: ConfirmPayOp;
|
||||||
[WalletApiOperation.AbortTransaction]: AbortTransactionOp;
|
[WalletApiOperation.AbortTransaction]: AbortTransactionOp;
|
||||||
[WalletApiOperation.CancelAbortingTransaction]: CancelAbortingTransactionOp;
|
[WalletApiOperation.FailTransaction]: FailTransactionOp;
|
||||||
[WalletApiOperation.SuspendTransaction]: SuspendTransactionOp;
|
[WalletApiOperation.SuspendTransaction]: SuspendTransactionOp;
|
||||||
[WalletApiOperation.ResumeTransaction]: ResumeTransactionOp;
|
[WalletApiOperation.ResumeTransaction]: ResumeTransactionOp;
|
||||||
[WalletApiOperation.GetBalances]: GetBalancesOp;
|
[WalletApiOperation.GetBalances]: GetBalancesOp;
|
||||||
|
@ -64,7 +64,7 @@ import {
|
|||||||
codecForAddKnownBankAccounts,
|
codecForAddKnownBankAccounts,
|
||||||
codecForAny,
|
codecForAny,
|
||||||
codecForApplyDevExperiment,
|
codecForApplyDevExperiment,
|
||||||
codecForCancelAbortingTransactionRequest,
|
codecForFailTransactionRequest,
|
||||||
codecForCheckPeerPullPaymentRequest,
|
codecForCheckPeerPullPaymentRequest,
|
||||||
codecForCheckPeerPushDebitRequest,
|
codecForCheckPeerPushDebitRequest,
|
||||||
codecForConfirmPayRequest,
|
codecForConfirmPayRequest,
|
||||||
@ -1237,8 +1237,8 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
|
|||||||
await suspendTransaction(ws, req.transactionId);
|
await suspendTransaction(ws, req.transactionId);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case WalletApiOperation.CancelAbortingTransaction: {
|
case WalletApiOperation.FailTransaction: {
|
||||||
const req = codecForCancelAbortingTransactionRequest().decode(payload);
|
const req = codecForFailTransactionRequest().decode(payload);
|
||||||
await failTransaction(ws, req.transactionId);
|
await failTransaction(ws, req.transactionId);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ export function TransactionPage({ tid, goToWalletHistory }: Props): VNode {
|
|||||||
<TransactionView
|
<TransactionView
|
||||||
transaction={state.response}
|
transaction={state.response}
|
||||||
onCancel={async () => {
|
onCancel={async () => {
|
||||||
await api.wallet.call(WalletApiOperation.CancelAbortingTransaction, {
|
await api.wallet.call(WalletApiOperation.FailTransaction, {
|
||||||
transactionId,
|
transactionId,
|
||||||
});
|
});
|
||||||
goToWalletHistory(currency);
|
goToWalletHistory(currency);
|
||||||
|
Loading…
Reference in New Issue
Block a user