fix: check for non-evm chains before doing the toHex cp-7.62.0#24746
fix: check for non-evm chains before doing the toHex cp-7.62.0#24746
Conversation
|
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. |
…aMask/metamask-mobile into NWNT-musd-cta-non-evm-chain-tron-fix
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes are limited to a UI hook ( Key observations:
The change doesn't affect:
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. |
|



Description
Fixes a render error when viewing tokens on Tron chain by adding
isNonEvmChainIdguard before calling toHex on chainId inuseMusdCtaVisibility.Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Prevents crashes when viewing tokens on non-EVM chains by skipping mUSD CTA logic for those chains.
isNonEvmChainIdcheck inshouldShowTokenListItemCtaofuseMusdCtaVisibilityto returnfalsefor non-EVMchainIdbefore callingtoHexuseMusdCtaVisibility.test.tsto mockisNonEvmChainIdand add assertions for Tron chain behaviorWritten by Cursor Bugbot for commit 643f568. This will update automatically on new commits. Configure here.