Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement distinction between BumpFee RBF & Cancel RBF -> utilise it to display error in case TX gets confirmed in cancel flow #16905

Merged

Conversation

peter-sanderson
Copy link
Contributor

@peter-sanderson peter-sanderson commented Feb 10, 2025

Resolve: #16875

image

image

@peter-sanderson peter-sanderson requested a review from a team as a code owner February 10, 2025 11:02
Copy link

coderabbitai bot commented Feb 10, 2025

Walkthrough

This pull request implements a comprehensive renaming and type update across multiple modules handling transaction logic. The primary change is the renaming of the type PrecomposedTransactionFinalRbf to PrecomposedTransactionFinalBumpFeeRbf, alongside the update of the function from isRbfTransaction to isRbfBumpFeeTransaction. Additionally, a new type, PrecomposedTransactionFinalCancelRbf, has been introduced to clearly differentiate cancel transactions. These changes are applied consistently across actions, thunks, middleware, and UI components, with adjustments in type assignments and parameter definitions to reflect the new naming conventions without affecting existing control flow or error handling logic.

Assessment against linked issues

Objective Addressed Explanation
Change modal state to error when original TX gets confirmed for RBF (16875)
Change modal state to error when original TX gets confirmed for Cancel (16875)

Possibly related PRs

Suggested labels

+Invity, code

Suggested reviewers

  • MiroslavProchazka
  • Lemonexe
  • jvaclavik
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@peter-sanderson peter-sanderson marked this pull request as draft February 10, 2025 11:03
Copy link

github-actions bot commented Feb 10, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 26
  • More info

Learn more about 𝝠 Expo Github Action

@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from ac9840b to f1a775a Compare February 10, 2025 11:18
@peter-sanderson peter-sanderson marked this pull request as ready for review February 10, 2025 11:18
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
suite-common/wallet-core/src/send/sendFormThunks.ts (1)

542-553: Consider using a type guard to simplify type assertions.

The multiple type assertions to PrecomposedTransactionFinalBumpFeeRbf could be simplified using a type guard function.

Consider adding a type guard:

function isBumpFeeRbf(tx: GeneralPrecomposedTransactionFinal): tx is PrecomposedTransactionFinalBumpFeeRbf {
    return 'prevTxid' in tx && 'feeDifference' in tx;
}

Then simplify the code:

-                (enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf).prevTxid =
-                    formValues.rbfParams.txid;
-                (enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf).feeDifference =
-                    new BigNumber(precomposedTransaction.fee)
-                        .minus(formValues.rbfParams.baseFee)
-                        .toFixed();
-                (enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf).useNativeRbf =
-                    !!useNativeRbf;
-                (
-                    enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf
-                ).useDecreaseOutput = !!hasDecreasedOutput;
+                const bumpFeeTx = enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf;
+                bumpFeeTx.prevTxid = formValues.rbfParams.txid;
+                bumpFeeTx.feeDifference = new BigNumber(precomposedTransaction.fee)
+                    .minus(formValues.rbfParams.baseFee)
+                    .toFixed();
+                bumpFeeTx.useNativeRbf = !!useNativeRbf;
+                bumpFeeTx.useDecreaseOutput = !!hasDecreasedOutput;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac9840b and f1a775a.

📒 Files selected for processing (14)
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts (4 hunks)
  • packages/suite/src/actions/wallet/stakeActions.ts (2 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (6 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx (3 hunks)
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts (1 hunks)
  • packages/suite/src/utils/suite/transactionReview.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormThunks.ts (2 hunks)
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts (5 hunks)
  • suite-common/wallet-types/src/transaction.ts (2 hunks)
  • suite-common/wallet-utils/src/accountUtils.ts (2 hunks)
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts (3 hunks)
  • suite-common/wallet-utils/src/transactionUtils.ts (2 hunks)
  • suite-native/module-send/src/selectors.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • packages/suite/src/actions/wallet/stakeActions.ts
  • suite-native/module-send/src/selectors.ts
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts
  • suite-common/wallet-utils/src/accountUtils.ts
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts
  • suite-common/wallet-utils/src/transactionUtils.ts
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: build-web
  • GitHub Check: prepare_android_test_app
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: EAS Update
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: Analyze with CodeQL (javascript)
  • GitHub Check: Setup and Cache Dependencies
🔇 Additional comments (6)
packages/suite/src/utils/suite/transactionReview.ts (1)

4-9: LGTM! Clear distinction between RBF actions.

The changes effectively separate RBF actions into bump fee and cancel operations, improving clarity and type safety.

Also applies to: 11-16, 27-33

packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts (2)

11-21: LGTM! Well-structured helper function.

The getPrevTxid helper function effectively handles both bump fee and cancel RBF cases with proper null safety.


29-43: LGTM! Improved error handling flow.

The middleware's early return pattern and null checks enhance code reliability.

suite-common/wallet-types/src/transaction.ts (3)

123-129: LGTM! Clear type definition for bump fee transactions.

The renamed type PrecomposedTransactionFinalBumpFeeRbf maintains all necessary properties with clear documentation.


131-133: LGTM! Well-defined cancel transaction type.

The new PrecomposedTransactionFinalCancelRbf type correctly captures the requirements for cancel transactions.


135-139: LGTM! Clear union type definition.

The updated PrecomposedTransactionFinal type properly represents all transaction variants.

@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from f1a775a to 44f7fb1 Compare February 10, 2025 11:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (1)

130-163: Consider refactoring the nested ternary operator.

While the logic is correct, the nested ternary operator can be hard to read. Consider using a more readable approach.

-            reportTransactionCreatedEvent(
-                // eslint-disable-next-line no-nested-ternary
-                isBumpFeeRbfAction ? 'replaced' : isCancelRbfAction ? 'canceled' : 'sent',
-            );
+            const getTransactionAction = () => {
+                if (isBumpFeeRbfAction) return 'replaced';
+                if (isCancelRbfAction) return 'canceled';
+                return 'sent';
+            };
+            reportTransactionCreatedEvent(getTransactionAction());
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44f7fb1 and 5ed49fb.

📒 Files selected for processing (2)
  • packages/suite-analytics/src/types/events.ts (1 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: build-web
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: prepare_android_test_app
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: Analyze with CodeQL (javascript)
  • GitHub Check: EAS Update
🔇 Additional comments (5)
packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (4)

17-18: LGTM!

The imports correctly reflect the new distinction between BumpFee RBF and Cancel RBF transactions.


74-75: LGTM!

The variable renaming from isRbfAction to isBumpFeeRbfAction and the addition of isCancelRbfAction improve code clarity by explicitly distinguishing between different RBF types.

Also applies to: 119-119


238-242: LGTM!

The component now correctly displays different error messages based on whether it's a cancel action or a replace-by-fee action.


252-252: LGTM!

The prop renaming maintains consistency with the variable renaming changes.

packages/suite-analytics/src/types/events.ts (1)

204-204: LGTM!

The addition of 'canceled' to the action type union correctly reflects the new possible action for transaction analytics.

@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from 5ed49fb to 5a88230 Compare February 10, 2025 12:05
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
suite-common/wallet-core/src/send/sendFormThunks.ts (1)

542-554: Reduce repeated type casting by using a temporary variable.

The code performs the same type cast multiple times which could be simplified for better maintainability.

Consider this refactor:

-                (enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf).prevTxid =
-                    formValues.rbfParams.txid;
-                (
-                    enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf
-                ).feeDifference = new BigNumber(precomposedTransaction.fee)
-                    .minus(formValues.rbfParams.baseFee)
-                    .toFixed();
-                (
-                    enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf
-                ).useNativeRbf = !!useNativeRbf;
-                (
-                    enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf
-                ).useDecreaseOutput = !!hasDecreasedOutput;
+                const bumpFeeRbf = enhancedPrecomposedTransaction as PrecomposedTransactionFinalBumpFeeRbf;
+                bumpFeeRbf.prevTxid = formValues.rbfParams.txid;
+                bumpFeeRbf.feeDifference = new BigNumber(precomposedTransaction.fee)
+                    .minus(formValues.rbfParams.baseFee)
+                    .toFixed();
+                bumpFeeRbf.useNativeRbf = !!useNativeRbf;
+                bumpFeeRbf.useDecreaseOutput = !!hasDecreasedOutput;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ed49fb and 5a88230.

📒 Files selected for processing (15)
  • packages/suite-analytics/src/types/events.ts (1 hunks)
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts (4 hunks)
  • packages/suite/src/actions/wallet/stakeActions.ts (2 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (6 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx (3 hunks)
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts (1 hunks)
  • packages/suite/src/utils/suite/transactionReview.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormThunks.ts (2 hunks)
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts (5 hunks)
  • suite-common/wallet-types/src/transaction.ts (2 hunks)
  • suite-common/wallet-utils/src/accountUtils.ts (2 hunks)
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts (4 hunks)
  • suite-common/wallet-utils/src/transactionUtils.ts (2 hunks)
  • suite-native/module-send/src/selectors.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • suite-native/module-send/src/selectors.ts
  • packages/suite/src/actions/wallet/stakeActions.ts
  • packages/suite-analytics/src/types/events.ts
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts
  • suite-common/wallet-types/src/transaction.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx
  • suite-common/wallet-utils/src/accountUtils.ts
  • packages/suite/src/utils/suite/transactionReview.ts
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: EAS Update
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: prepare_android_test_app
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: Analyze with CodeQL (javascript)
  • GitHub Check: build-web
  • GitHub Check: build-web
  • GitHub Check: Setup and Cache Dependencies
🔇 Additional comments (3)
suite-common/wallet-core/src/send/sendFormThunks.ts (1)

16-16: LGTM! Type import aligns with RBF distinction.

The addition of PrecomposedTransactionFinalBumpFeeRbf type import supports the PR's objective to distinguish between BumpFee RBF and Cancel RBF transactions.

suite-common/wallet-utils/src/transactionUtils.ts (2)

13-14: LGTM! Import changes align with the PR objectives.

The addition of PrecomposedTransactionFinalBumpFeeRbf and PrecomposedTransactionFinalCancelRbf types supports the distinction between BumpFee RBF and Cancel RBF transactions.


66-73: LGTM! Function changes implement clear distinction between RBF types.

The implementation correctly distinguishes between BumpFee RBF and Cancel RBF transactions through distinct type guards and property checks.

Let's verify the usage of these functions in the codebase:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Verify the usage of RBF type guard functions.

# Test: Search for usages of both functions. Expect: Consistent usage across the codebase.
echo "Searching for isRbfBumpFeeTransaction usage:"
rg -A 2 $'isRbfBumpFeeTransaction'

echo -e "\nSearching for isRbfCancelTransaction usage:"
rg -A 2 $'isRbfCancelTransaction'

Length of output: 8698


LGTM! The type guards now are correctly implemented and used consistently across the codebase.

  • isRbfBumpFeeTransaction is widely referenced in transaction processing and state management files.
  • isRbfCancelTransaction is appropriately used in transaction review components and error middleware.

Copy link
Contributor

@Lemonexe Lemonexe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments 🗨️
Technically OK, but I'd strongly advocate to refactor the interfaces as per comment before merging. Plus the nested ternary but that's a nit.

@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from 5a88230 to 4acdabc Compare February 10, 2025 16:46
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (1)

160-163: Consider using early returns for better readability.

The nested ternary operator makes the code harder to read.

-            reportTransactionCreatedEvent(
-                // eslint-disable-next-line no-nested-ternary
-                isBumpFeeRbfAction ? 'replaced' : isCancelRbfAction ? 'canceled' : 'sent',
-            );
+            if (isBumpFeeRbfAction) return reportTransactionCreatedEvent('replaced');
+            if (isCancelRbfAction) return reportTransactionCreatedEvent('canceled');
+            reportTransactionCreatedEvent('sent');
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a88230 and 4acdabc.

📒 Files selected for processing (15)
  • packages/suite-analytics/src/types/events.ts (1 hunks)
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts (4 hunks)
  • packages/suite/src/actions/wallet/stakeActions.ts (2 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (6 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx (3 hunks)
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts (1 hunks)
  • packages/suite/src/utils/suite/transactionReview.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormThunks.ts (2 hunks)
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts (5 hunks)
  • suite-common/wallet-types/src/transaction.ts (3 hunks)
  • suite-common/wallet-utils/src/accountUtils.ts (2 hunks)
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts (4 hunks)
  • suite-common/wallet-utils/src/transactionUtils.ts (2 hunks)
  • suite-native/module-send/src/selectors.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • suite-native/module-send/src/selectors.ts
  • packages/suite/src/actions/wallet/stakeActions.ts
  • packages/suite-analytics/src/types/events.ts
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts
  • packages/suite/src/utils/suite/transactionReview.ts
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts
  • suite-common/wallet-utils/src/accountUtils.ts
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: EAS Update
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: prepare_android_test_app
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: build-web
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (12)
suite-common/wallet-types/src/transaction.ts (4)

106-112: LGTM!

The renaming of TxFinal to PrecomposedTransactionBase better reflects its role as a base type for all final transactions.


123-130: LGTM!

The PrecomposedTransactionFinalBumpFeeRbf type correctly extends the base type and adds RBF-specific properties with a discriminator property rbfType: 'bump-fee'.


132-135: LGTM!

The PrecomposedTransactionFinalCancelRbf type correctly extends the base type and adds cancel-specific properties with a discriminator property rbfType: 'cancel'.


137-141: LGTM!

The union type PrecomposedTransactionFinal now clearly distinguishes between normal, bump-fee, and cancel transactions using the discriminator property.

packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (3)

74-75: LGTM!

The variable name isBumpFeeRbfAction and the use of isRbfBumpFeeTransaction clearly indicate the type of RBF action being performed.


119-119: LGTM!

Added check for cancel RBF transactions using the new type guard function.


238-242: LGTM!

The component correctly displays different error messages based on whether it's a cancel or replace-by-fee transaction.

suite-common/wallet-core/src/send/sendFormThunks.ts (2)

536-553: LGTM!

The createGeneralPrecomposedTransactionFinal function correctly handles the enhancement of RBF transactions:

  1. Checks for non-Cardano transactions with RBF parameters
  2. Adds the rbfType discriminator
  3. Preserves all required RBF-specific properties

555-555: LGTM!

The function is correctly used to enhance the precomposed transaction.

suite-common/wallet-utils/src/transactionUtils.ts (3)

66-69: LGTM!

The isRbfTransaction type guard correctly uses the rbfType discriminator to identify RBF transactions.


71-74: LGTM!

The isRbfBumpFeeTransaction type guard correctly identifies bump fee transactions by checking both the presence of rbfType and its value.


75-77: LGTM!

The isRbfCancelTransaction type guard correctly identifies cancel transactions by checking both the presence of rbfType and its value.

return precomposedTransaction;
};

const enhancedPrecomposedTransaction = createGeneralPrecomposedTransactionFinal();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole diff is awesome 🎉 the original code was barely legible with (as) on lefthand side of assignment operation 😅

@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from ece6c12 to a499e63 Compare February 10, 2025 17:00
Copy link
Contributor

@PeKne PeKne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from suite-native point of view. Did not test desktop implementation.

@@ -70,10 +71,13 @@ export const TransactionReviewModalContent = ({
);

const isTradingAction = !!precomposedForm?.isTrading;
const isRbfAction = precomposedTx !== undefined && isRbfTransaction(precomposedTx);
const isBumpFeeRbfAction =
precomposedTx !== undefined && isRbfBumpFeeTransaction(precomposedTx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: handling of undefined could be moved inside of the isRbfBumpFeeTransaction type guard.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (1)

167-171: Simplify the event reporting logic.

The nested ternary could be simplified using early returns for better readability.

-            reportTransactionCreatedEvent(
-                isRbfTransaction(precomposedTx)
-                    ? mapRbfTypeToReporting[precomposedTx.rbfType]
-                    : 'sent',
-            );
+            if (isRbfTransaction(precomposedTx)) {
+                return reportTransactionCreatedEvent(mapRbfTypeToReporting[precomposedTx.rbfType]);
+            }
+            reportTransactionCreatedEvent('sent');
🛑 Comments failed to post (1)
packages/suite-analytics/src/types/events.ts (1)

39-55: 💡 Verification agent

🧩 Analysis chain

LGTM! New analytics event type is well-structured.

The TransactionCreatedEvent type is well-defined with a comprehensive payload structure that includes the new 'canceled' action.

Based on the past review comments, please verify that the analytics documentation has been updated to reflect these changes:


🌐 Web query:

Is there documentation for the "canceled" transaction action in the Trezor Suite analytics documentation?

💡 Result:

Trezor Suite's analytics documentation does not explicitly mention a "canceled" transaction action as a tracked event. However, several related aspects of transaction handling and error tracking are documented:

  1. Error Tracking:
    Trezor Suite uses Sentry.io for error monitoring[1], which would capture transaction failures or rejections like canceled actions. The system stores error-related data for 90 days[1].

  2. Transaction Status Terminology:
    Code references show status labels like:

    • TR_EXCHANGE_STATUS_ERROR: 'Rejected'[2]
    • TR_EXCHANGE_DETAIL_ERROR_TITLE: 'Transaction failed'[2]
      While not explicitly "canceled," these indicate similar terminal states.
  3. Data Collection Scope:
    Analytics collect "user interactions with app functions" and errors[1], suggesting canceled transactions would fall under either:

    • Functional interaction data (if user-initiated cancellation)
    • Error reports (if system-rejected)[1]
  4. Export Capabilities:
    Transaction exports (JSON/CSV/PDF) include comprehensive metadata[5], though cancellation status isn't specifically mentioned in documentation.

There's no direct reference to a dedicated "canceled" transaction metric in the official docs[1][3][9], but the infrastructure exists to capture related events through error tracking and interaction logging[1][2]. For implementation details, developers would need to consult Trezor Suite's source code[2].

Citations:


Documentation Update Needed: "canceled" Transaction Event Missing

The analytics documentation does not explicitly document the new "canceled" transaction action. While error tracking and related behaviors are mentioned, there’s no dedicated explanation or reference to this new action.

  • Verify if the intended design was to document "canceled" directly.
  • Consider updating the analytics docs to explicitly include the "canceled" transaction action for clarity.

Copy link
Contributor

@Lemonexe Lemonexe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better, amazing refactoring in last fixup 👌 👌 👌
Thank you for taking such care with codebase 🤗

@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from a499e63 to d544557 Compare February 10, 2025 17:06
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
suite-common/wallet-core/src/send/sendFormThunks.ts (1)

536-553: Add JSDoc documentation for the new function.

The function createGeneralPrecomposedTransactionFinal handles important RBF transaction logic. Consider adding JSDoc documentation to explain:

  • The purpose of the function
  • The conditions under which it enhances transactions
  • The significance of the RBF properties being set
+/**
+ * Creates an enhanced transaction with RBF (Replace-By-Fee) properties if applicable.
+ * For non-Cardano transactions with RBF parameters, it adds bump-fee specific properties
+ * such as rbfType, prevTxid, feeDifference, and RBF capability flags.
+ * @returns {GeneralPrecomposedTransactionFinal} Enhanced transaction with RBF properties if applicable
+ */
 const createGeneralPrecomposedTransactionFinal = (): GeneralPrecomposedTransactionFinal => {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a499e63 and d544557.

📒 Files selected for processing (17)
  • packages/suite-analytics/src/types/events.ts (2 hunks)
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts (4 hunks)
  • packages/suite/src/actions/wallet/stakeActions.ts (2 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (7 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx (4 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx (1 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ReplaceByFeeFailedOriginalTxConfirmed.tsx (2 hunks)
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts (1 hunks)
  • packages/suite/src/utils/suite/transactionReview.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormThunks.ts (2 hunks)
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts (5 hunks)
  • suite-common/wallet-types/src/transaction.ts (3 hunks)
  • suite-common/wallet-utils/src/accountUtils.ts (2 hunks)
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts (4 hunks)
  • suite-common/wallet-utils/src/transactionUtils.ts (2 hunks)
  • suite-native/module-send/src/selectors.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (15)
  • packages/suite/src/actions/wallet/stakeActions.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx
  • packages/suite-analytics/src/types/events.ts
  • packages/suite/src/utils/suite/transactionReview.ts
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ReplaceByFeeFailedOriginalTxConfirmed.tsx
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts
  • suite-native/module-send/src/selectors.ts
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts
  • suite-common/wallet-utils/src/accountUtils.ts
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts
  • suite-common/wallet-types/src/transaction.ts
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: build-web
  • GitHub Check: Analyze with CodeQL (javascript)
  • GitHub Check: prepare_android_test_app
  • GitHub Check: EAS Update
🔇 Additional comments (5)
suite-common/wallet-utils/src/transactionUtils.ts (2)

13-14: LGTM! Import changes align with RBF distinction.

The addition of separate types for BumpFee and Cancel RBF transactions enhances type safety and clarity.


66-78: LGTM! Well-structured type guards for RBF transactions.

The implementation:

  1. Uses TypeScript type guards effectively for type safety
  2. Clearly distinguishes between BumpFee and Cancel RBF transactions
  3. Follows a consistent pattern across all three functions
suite-common/wallet-core/src/send/sendFormThunks.ts (3)

16-16: LGTM! Import of new RBF type.

The import of PrecomposedTransactionFinalBumpFeeRbf aligns with the PR's objective to distinguish between different RBF transaction types.


555-555: LGTM! Clean integration of the enhanced transaction.

The enhanced transaction is properly integrated into the existing flow, maintaining compatibility with token verification and redux state management.

Also applies to: 576-581


538-547: Verify the impact on Cancel RBF flow.

The implementation clearly handles the bump-fee RBF case. Let's verify that this doesn't adversely affect the cancel RBF flow.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Search for cancel RBF related code to ensure it's properly handled
rg -A 5 "rbfType.*cancel" || echo "No explicit cancel RBF type handling found"

# Search for RBF type definitions
ast-grep --pattern 'type RbfTransactionType = $_'

Length of output: 2157


Verify Cancel RBF Flow Handling

The shell script output confirms that the cancel RBF flow is explicitly managed in the codebase:

  • The CancelTransactionModal.tsx file sets rbfType to 'cancel' when preparing a cancel transaction.
  • The type definition in suite-common/wallet-types/src/transaction.ts clearly distinguishes between 'bump-fee' and 'cancel' via the RbfTransactionType union.

These findings indicate that the bump-fee enhancements will not adversely affect the cancel RBF flow.

@peter-sanderson peter-sanderson changed the title feat: implement distinction between BumpFee RBF & Cancel RBF -> utilise it to display error in case TX gets confirmed in cancel flow [MERGE AFTER MOBILE FREEZE] feat: implement distinction between BumpFee RBF & Cancel RBF -> utilise it to display error in case TX gets confirmed in cancel flow Feb 10, 2025
@peter-sanderson peter-sanderson changed the title [MERGE AFTER MOBILE FREEZE] feat: implement distinction between BumpFee RBF & Cancel RBF -> utilise it to display error in case TX gets confirmed in cancel flow feat: implement distinction between BumpFee RBF & Cancel RBF -> utilise it to display error in case TX gets confirmed in cancel flow Feb 11, 2025
…se it to display error in case TX gets confirmed in cancel flow

feat: extend reporting for 'canceled' event in sendform
@peter-sanderson peter-sanderson force-pushed the cancel-transaction-screen-2-error-for-cancel-sign branch from d544557 to 817360d Compare February 11, 2025 18:12
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
suite-common/wallet-core/src/send/sendFormThunks.ts (1)

536-556: Consider enhancing type safety and modularity.

The implementation of createGeneralPrecomposedTransactionFinal is solid and aligns well with the PR's objective. However, there are a few potential improvements:

  1. Extract fee difference calculation to a separate function for better modularity.
  2. Add type guard for formValues.rbfParams to enhance type safety.

Consider this refactoring:

+const calculateFeeDifference = (newFee: string, baseFee: string): string =>
+    new BigNumber(newFee).minus(baseFee).toFixed();

 const createGeneralPrecomposedTransactionFinal = (): GeneralPrecomposedTransactionFinal => {
-    if (!isCardanoTx(selectedAccount, precomposedTransaction) && formValues.rbfParams) {
+    if (!isCardanoTx(selectedAccount, precomposedTransaction) && 
+        formValues.rbfParams &&
+        'fee' in precomposedTransaction) {
         const enhancedRbfPrecomposedTx: PrecomposedTransactionFinalBumpFeeRbf = {
             ...precomposedTransaction,
             rbfType: 'bump-fee',
             prevTxid: formValues.rbfParams.txid,
-            feeDifference: new BigNumber(precomposedTransaction.fee)
-                .minus(formValues.rbfParams.baseFee)
-                .toFixed(),
+            feeDifference: calculateFeeDifference(
+                precomposedTransaction.fee,
+                formValues.rbfParams.baseFee
+            ),
             useNativeRbf: !!useNativeRbf,
             useDecreaseOutput: !!hasDecreasedOutput,
         };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d544557 and 817360d.

📒 Files selected for processing (17)
  • packages/suite-analytics/src/types/events.ts (2 hunks)
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts (4 hunks)
  • packages/suite/src/actions/wallet/stakeActions.ts (2 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx (7 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx (4 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx (1 hunks)
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ReplaceByFeeFailedOriginalTxConfirmed.tsx (2 hunks)
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts (1 hunks)
  • packages/suite/src/utils/suite/transactionReview.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts (2 hunks)
  • suite-common/wallet-core/src/send/sendFormThunks.ts (2 hunks)
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts (5 hunks)
  • suite-common/wallet-types/src/transaction.ts (3 hunks)
  • suite-common/wallet-utils/src/accountUtils.ts (2 hunks)
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts (4 hunks)
  • suite-common/wallet-utils/src/transactionUtils.ts (2 hunks)
  • suite-native/module-send/src/selectors.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (14)
  • packages/suite-analytics/src/types/events.ts
  • packages/suite/src/actions/wallet/stakeActions.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx
  • suite-common/wallet-core/src/send/sendFormBitcoinThunks.ts
  • packages/suite/src/middlewares/wallet/replaceByFeeErrorMiddleware.ts
  • suite-native/module-send/src/selectors.ts
  • suite-common/wallet-utils/src/accountUtils.ts
  • packages/suite/src/utils/suite/transactionReview.ts
  • suite-common/wallet-utils/src/reviewTransactionUtils.ts
  • packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/CancelTransaction/CancelTransactionModal.tsx
  • packages/suite/src/actions/wallet/send/sendFormThunks.ts
  • suite-common/wallet-core/src/transactions/transactionsThunks.ts
  • suite-common/wallet-types/src/transaction.ts
  • packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: EAS Update
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: prepare_android_test_app
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: build-web
  • GitHub Check: build-web
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (9)
suite-common/wallet-utils/src/transactionUtils.ts (3)

13-14: LGTM! Clear type imports for RBF transaction handling.

The addition of separate types for BumpFee and Cancel RBF transactions improves type safety and clarity.


66-69: LGTM! Improved type safety in RBF transaction check.

The function now correctly returns a union type and uses a more reliable property check.


71-77: LGTM! Well-structured type guard functions.

The new functions provide clear and type-safe ways to distinguish between bump-fee and cancel RBF transactions. The implementation is clean and follows TypeScript best practices.

suite-common/wallet-core/src/send/sendFormThunks.ts (1)

16-16: LGTM!

The addition of PrecomposedTransactionFinalBumpFeeRbf type import aligns with the PR's objective to distinguish between different RBF transaction types.

packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ReplaceByFeeFailedOriginalTxConfirmed.tsx (5)

1-1: LGTM! Good type safety improvements.

The changes improve type safety by:

  • Using a dedicated RbfTransactionType instead of string literals
  • Making the type definition exportable for reuse

Also applies to: 13-15


32-51: LGTM! Clean and user-friendly error UI implementation.

The component provides a good user experience by:

  • Displaying a clear warning icon
  • Showing appropriate error messages based on the RBF type
  • Providing help resources through documentation links

22-25: Verify description translation keys exist.

Please ensure that the translation keys TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED_DESCRIPTION and TR_CANCEL_TX_FAILED_ALREADY_MINED_DESCRIPTION exist in the translation files.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Search for the translation keys in translation files
rg "TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED_DESCRIPTION|TR_CANCEL_TX_FAILED_ALREADY_MINED_DESCRIPTION" -A 1

Length of output: 2189


Translation key verification completed: Keys exist.

Both translation keys TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED_DESCRIPTION and TR_CANCEL_TX_FAILED_ALREADY_MINED_DESCRIPTION were found in the translation data as well as referenced in support messages.


17-20: Verify translation keys exist.

Please ensure that the translation keys TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED and TR_CANCEL_TX_FAILED_ALREADY_MINED exist in the translation files.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Search for the translation keys in translation files
rg "TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED|TR_CANCEL_TX_FAILED_ALREADY_MINED" -A 1

Length of output: 3675


Translation keys have been verified successfully.

  • The keys TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED and TR_CANCEL_TX_FAILED_ALREADY_MINED are present in the English translation file (packages/suite-data/files/translations/en.json) as well as in the support messages file.
  • Both the primary keys and their corresponding description keys exist, ensuring proper mapping for UI messages.

27-30: Verify help center URLs are valid.

Please ensure that the imported URL constants HELP_CENTER_REPLACE_BY_FEE_BITCOIN and HELP_CENTER_CANCEL_TRANSACTION point to valid help center articles.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Search for URL constant definitions
rg "HELP_CENTER_REPLACE_BY_FEE_BITCOIN|HELP_CENTER_CANCEL_TRANSACTION.*=.*" -A 1

Length of output: 1749


Help Center URLs Verified

The search confirms that the URL constants are defined in the repository as follows:

  • HELP_CENTER_REPLACE_BY_FEE_BITCOIN: 'https://trezor.io/learn/a/replace-by-fee-rbf-bitcoin'
  • HELP_CENTER_CANCEL_TRANSACTION: 'https://trezor.io/support/a/can-i-cancel-or-reverse-a-transaction'

Both constants correctly point to valid help center articles as expected. No issues were found.

@peter-sanderson peter-sanderson merged commit f51e5e0 into develop Feb 12, 2025
31 of 32 checks passed
@peter-sanderson peter-sanderson deleted the cancel-transaction-screen-2-error-for-cancel-sign branch February 12, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RBF transaction mined before RBFed
3 participants