chore: filter out Tron staking special assets#26360
Conversation
|
Cursor Agent can help with this pull request. Just |
fb394aa to
5e00ccb
Compare
494bf95 to
37534d4
Compare
|
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. |
fc35db3 to
ca1b934
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
ca1b934 to
1607599
Compare
Made-with: Cursor
1607599 to
893e98a
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key Changes:
Tag Selection Rationale:
Not Selected:
The changes are primarily internal refactoring with consistent behavior - the filtering logic is being consolidated and extended to cover more Tron special asset types. Performance Test Selection: |
The committed fixture schema is out of date. To update, comment: |
|
## Explanation Tweak the symbols to match both MetaMask/metamask-extension#40540 and MetaMask/metamask-mobile#26360 ## References n/a ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [x] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them



Description
As part of Tron's staking experience improvements we will be sending more special assets from the Snap to the Extension. These special assets are not tradeable tokens and should be filtered out from selectors like we already do for Staked TRX for example.
This PR:
Changelog
CHANGELOG entry: null
Related issues
Closes: NEB-582, NEB-584, NEB-586
Manual testing steps
All existing Tron functionality should remain unchanged
Screenshots/Recordings
As you can see, the new assets being loaded from the preview build of MetaMask/snap-tron-wallet#226 are not being shown here.
Before
n/a
After
n/a
Pre-merge author checklist
Note
Medium Risk
Changes token/asset filtering for Tron by excluding additional Snap-provided “special assets” from sorted asset lists and unified multichain token lists, which could inadvertently hide tokens if symbols collide or filtering is misapplied. Scope is contained to Tron selectors/utilities and related UI consumers, with broad test updates.
Overview
Introduces a broader Tron “special assets” concept (resources + staking lifecycle assets) and filters these virtual tokens out of user-facing asset/token lists.
Renames and expands the Tron selector from
selectTronResourcesBySelectedAccountGrouptoselectTronSpecialAssetsBySelectedAccountGroup(andTronResourcesMaptoTronSpecialAssetsMap), adding mappings fortrxReadyForWithdrawal,trxStakingRewards, andtrxInLockPeriodwhile preservingtotalStakedTrxcomputation.Centralizes special-asset detection in
core/Multichain/utilsviaisTronSpecialAssetand reuses it inselectSortedAssetsBySelectedAccountGroup,selectAccountTokensAcrossChainsUnified, and BridgeisTradableToken; updates related Earn/TokenDetails/AssetOverview hooks and tests accordingly.Written by Cursor Bugbot for commit 893e98a. This will update automatically on new commits. Configure here.