Skip to content

fix: check for non-evm chains before doing the toHex cp-7.62.0#24746

Merged
zone-live merged 5 commits intomainfrom
NWNT-musd-cta-non-evm-chain-tron-fix
Jan 16, 2026
Merged

fix: check for non-evm chains before doing the toHex cp-7.62.0#24746
zone-live merged 5 commits intomainfrom
NWNT-musd-cta-non-evm-chain-tron-fix

Conversation

@zone-live
Copy link
Copy Markdown
Contributor

@zone-live zone-live commented Jan 16, 2026

Description

Fixes a render error when viewing tokens on Tron chain by adding isNonEvmChainId guard before calling toHex on chainId in useMusdCtaVisibility.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

Screenshot 2026-01-16 at 11 59 58

After

Screenshot 2026-01-16 at 12 01 27

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Prevents crashes when viewing tokens on non-EVM chains by skipping mUSD CTA logic for those chains.

  • Add isNonEvmChainId check in shouldShowTokenListItemCta of useMusdCtaVisibility to return false for non-EVM chainId before calling toHex
  • Update tests in useMusdCtaVisibility.test.ts to mock isNonEvmChainId and add assertions for Tron chain behavior

Written by Cursor Bugbot for commit 643f568. This will update automatically on new commits. Configure here.

@zone-live zone-live requested a review from a team as a code owner January 16, 2026 12:03
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-networks Networks team label Jan 16, 2026
@zone-live zone-live added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 16, 2026
@github-actions github-actions bot added size-S and removed size-XS labels Jan 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

The changes are limited to a UI hook (useMusdCtaVisibility.ts) that controls the visibility of mUSD-related CTAs (Call-to-Action buttons) in the Earn feature. The modification adds a defensive check using isNonEvmChainId to prevent showing the token list item CTA on non-EVM chains like Tron.

Key observations:

  1. Scope: Small, focused change - adds one import and a 4-line guard condition
  2. Purpose: Defensive change to hide CTAs on unsupported (non-EVM) chains
  3. Testing: Comprehensive unit tests added covering the new behavior
  4. No E2E coverage: There are no existing E2E tests for the Earn/mUSD feature in the e2e/specs directory
  5. Impact: Only affects UI visibility logic, not core wallet functionality

The change doesn't affect:

  • Core wallet operations
  • Transaction confirmations
  • Account management
  • Network switching
  • Any critical user flows

Since this is a low-risk UI visibility change with good unit test coverage and no existing E2E tests for this specific feature, no E2E test tags are required.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@zone-live zone-live added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 8a57626 Jan 16, 2026
57 checks passed
@zone-live zone-live deleted the NWNT-musd-cta-non-evm-chain-tron-fix branch January 16, 2026 14:12
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-networks Networks team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants