-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: cp-7.60.0 filter out tron staked tokens from send flow #22979
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
fix: cp-7.60.0 filter out tron staked tokens from send flow #22979
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes introduce a new filtering mechanism for Tron resource assets in the asset selection system. Here's the impact analysis: What Changed:
Impact Areas:
Risk Assessment - Medium:
Why Not Selected:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: selectAsset uses unfiltered assets selector
The selectAsset selector uses selectAssetsBySelectedAccountGroup instead of selectFilteredAssetsBySelectedAccountGroup, bypassing the TRON staked token filtering. This means components using selectAsset to look up specific assets can still retrieve TRON staked tokens that should be filtered out from the send flow, defeating the purpose of this PR.
app/selectors/assets/assets-list.ts#L307-L308
metamask-mobile/app/selectors/assets/assets-list.ts
Lines 307 to 308 in 8f9af0e
| ( | |
| _state: RootState, |
|



Description
TRON staked tokens were visible in the send flow. This PR modifies some selectors so that we filter out TRON staked tokens.
Changelog
CHANGELOG entry: fix: filter out TRON staked tokens
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1814
Manual testing steps
Screenshots/Recordings
Before
After
https://www.loom.com/share/e5ca32a5434e46ab907d8832ab3af239
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Exclude Tron staked bandwidth/energy assets from token lists by introducing a filtered assets selector, wiring it into the send tokens hook and sorting selector, with accompanying tests.
selectFilteredAssetsBySelectedAccountGroupto remove Tron resource symbols (ENERGY,BANDWIDTH, and staked variants) acrossTrxScopenetworks.selectSortedAssetsBySelectedAccountGroupto consume the filtered selector.useAccountTokensnow usesselectFilteredAssetsBySelectedAccountGroupto exclude Tron staked/resource tokens in the send flow.selectFilteredAssetsBySelectedAccountGroupTron filtering.useAccountTokenstests to use the new selector.toStrictEqualfor assets shape.Written by Cursor Bugbot for commit 8f9af0e. This will update automatically on new commits. Configure here.