diff options
author | Florian Dold <florian@dold.me> | 2023-06-20 19:41:36 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-20 19:41:42 +0200 |
commit | 8d20ab87fa43c9b4e86ff424084008dcf680e8c3 (patch) | |
tree | 996c5f265779f264c62f7460b7acd277814a9bf7 | |
parent | 32937795c59fa91e4ff07a10a1f2497135d1937b (diff) |
wallet-core: consistently rename to failTransaction
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 12 | ||||
-rw-r--r-- | packages/taler-wallet-cli/src/index.ts | 11 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet-api-types.ts | 16 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 6 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Transaction.tsx | 2 |
5 files changed, 23 insertions, 24 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 5a87864fc..20e80f815 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -1920,15 +1920,15 @@ export const codecForAcceptTipRequest = (): Codec<AcceptTipRequest> => .property("walletTipId", codecForString()) .build("AcceptTipRequest"); -export interface CancelAbortingTransactionRequest { +export interface FailTransactionRequest { transactionId: TransactionIdStr; } -export const codecForCancelAbortingTransactionRequest = - (): Codec<CancelAbortingTransactionRequest> => - buildCodecForObject<CancelAbortingTransactionRequest>() +export const codecForFailTransactionRequest = + (): Codec<FailTransactionRequest> => + buildCodecForObject<FailTransactionRequest>() .property("transactionId", codecForTransactionIdStr()) - .build("CancelAbortingTransactionRequest"); + .build("FailTransactionRequest"); export interface SuspendTransactionRequest { transactionId: TransactionIdStr; @@ -1953,7 +1953,7 @@ export interface AbortTransactionRequest { transactionId: TransactionIdStr; } -export interface CancelAbortingTransactionRequest { +export interface FailTransactionRequest { transactionId: TransactionIdStr; } diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index 99882addd..4e56a40f4 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -446,17 +446,16 @@ transactionsCli }); transactionsCli - .subcommand("cancelAbortingTransaction", "cancel-aborting", { - help: "Cancel the attempt of properly aborting a transaction.", + .subcommand("fail", "fail", { + help: "Fail a transaction (when it can't be aborted).", }) .requiredArgument("transactionId", clk.STRING, { - help: "Identifier of the transaction to cancel aborting.", + help: "Identifier of the transaction to fail.", }) .action(async (args) => { await withWallet(args, async (wallet) => { - await wallet.client.call(WalletApiOperation.CancelAbortingTransaction, { - transactionId: args.cancelAbortingTransaction - .transactionId as TransactionIdStr, + await wallet.client.call(WalletApiOperation.FailTransaction, { + transactionId: args.fail.transactionId as TransactionIdStr, }); }); }); diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index c58ced045..fdda4c4c2 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -38,7 +38,7 @@ import { ApplyDevExperimentRequest, BackupRecovery, BalancesResponse, - CancelAbortingTransactionRequest, + FailTransactionRequest, CheckPeerPullCreditRequest, CheckPeerPullCreditResponse, CheckPeerPushDebitRequest, @@ -166,9 +166,11 @@ export enum WalletApiOperation { GetExchangeDetailedInfo = "getExchangeDetailedInfo", RetryPendingNow = "retryPendingNow", AbortTransaction = "abortTransaction", - CancelAbortingTransaction = "cancelAbortingTransaction", + FailTransaction = "failTransaction", SuspendTransaction = "suspendTransaction", ResumeTransaction = "resumeTransaction", + DeleteTransaction = "deleteTransaction", + RetryTransaction = "retryTransaction", ConfirmPay = "confirmPay", DumpCoins = "dumpCoins", SetCoinSuspended = "setCoinSuspended", @@ -184,8 +186,6 @@ export enum WalletApiOperation { GetBackupInfo = "getBackupInfo", PrepareDeposit = "prepareDeposit", GetVersion = "getVersion", - DeleteTransaction = "deleteTransaction", - RetryTransaction = "retryTransaction", ListCurrencies = "listCurrencies", GenerateDepositGroupTxId = "generateDepositGroupTxId", CreateDepositGroup = "createDepositGroup", @@ -384,9 +384,9 @@ export type AbortTransactionOp = { * * For payment transactions, it puts the payment into an "aborting" state. */ -export type CancelAbortingTransactionOp = { - op: WalletApiOperation.CancelAbortingTransaction; - request: CancelAbortingTransactionRequest; +export type FailTransactionOp = { + op: WalletApiOperation.FailTransaction; + request: FailTransactionRequest; response: EmptyObject; }; @@ -979,7 +979,7 @@ export type WalletOperations = { [WalletApiOperation.WithdrawTestkudos]: WithdrawTestkudosOp; [WalletApiOperation.ConfirmPay]: ConfirmPayOp; [WalletApiOperation.AbortTransaction]: AbortTransactionOp; - [WalletApiOperation.CancelAbortingTransaction]: CancelAbortingTransactionOp; + [WalletApiOperation.FailTransaction]: FailTransactionOp; [WalletApiOperation.SuspendTransaction]: SuspendTransactionOp; [WalletApiOperation.ResumeTransaction]: ResumeTransactionOp; [WalletApiOperation.GetBalances]: GetBalancesOp; diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index af6bb4d62..3ceb6b069 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -64,7 +64,7 @@ import { codecForAddKnownBankAccounts, codecForAny, codecForApplyDevExperiment, - codecForCancelAbortingTransactionRequest, + codecForFailTransactionRequest, codecForCheckPeerPullPaymentRequest, codecForCheckPeerPushDebitRequest, codecForConfirmPayRequest, @@ -1237,8 +1237,8 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( await suspendTransaction(ws, req.transactionId); return {}; } - case WalletApiOperation.CancelAbortingTransaction: { - const req = codecForCancelAbortingTransactionRequest().decode(payload); + case WalletApiOperation.FailTransaction: { + const req = codecForFailTransactionRequest().decode(payload); await failTransaction(ws, req.transactionId); return {}; } diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index 80f0479c8..9ed41c5de 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -121,7 +121,7 @@ export function TransactionPage({ tid, goToWalletHistory }: Props): VNode { <TransactionView transaction={state.response} onCancel={async () => { - await api.wallet.call(WalletApiOperation.CancelAbortingTransaction, { + await api.wallet.call(WalletApiOperation.FailTransaction, { transactionId, }); goToWalletHistory(currency); |