revert: revert: staking improvements' special assets#226
Merged
Conversation
This reverts commit 6c5902b.
1d9b55b to
ad1da3d
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
maxime-oe
approved these changes
Mar 4, 2026
This was referenced Mar 4, 2026
bizk
approved these changes
Mar 4, 2026
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Mar 6, 2026
## **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: - Adds the new special assets that should be ignored by the selectors - Renames the variables that deal with this logic to be more inclusive of assets that are not resources (only Energy and Bandwidth are resources) ## **Changelog** CHANGELOG entry: null ## **Related issues** Closes: [NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582), [NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584), [NEB-586](https://consensyssoftware.atlassian.net/browse/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** - [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards. - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using JSDoc format if applicable - [x] I've applied the right labels on the PR [NEB-582]: https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-584]: https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-586]: https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!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 `selectTronResourcesBySelectedAccountGroup` to `selectTronSpecialAssetsBySelectedAccountGroup` (and `TronResourcesMap` to `TronSpecialAssetsMap`), adding mappings for `trxReadyForWithdrawal`, `trxStakingRewards`, and `trxInLockPeriod` while preserving `totalStakedTrx` computation. > > Centralizes special-asset detection in `core/Multichain/utils` via `isTronSpecialAsset` and reuses it in `selectSortedAssetsBySelectedAccountGroup`, `selectAccountTokensAcrossChainsUnified`, and Bridge `isTradableToken`; updates related Earn/TokenDetails/AssetOverview hooks and tests accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 893e98a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 6, 2026
## **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: - Adds the new special assets that should be ignored by the selectors - Renames the variables that deal with this logic to be more inclusive of assets that are not resources (only Energy and Bandwidth are resources) [](https://codespaces.new/MetaMask/metamask-extension/pull/40540?quickstart=1) ## **Changelog** CHANGELOG entry: null ## **Related issues** Closes: [NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582), [NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584), [NEB-586](https://consensyssoftware.atlassian.net/browse/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** https://github.com/user-attachments/assets/1b4f445f-ab72-486e-a8b5-e177a33b5d8f ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [NEB-582]: https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-584]: https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-586]: https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes token/balance filtering across several UI and bridge selectors based on CAIP parsing; misclassification could hide legitimate Tron assets or affect displayed totals, though covered by new/updated tests. > > **Overview** > Adds a CAIP-based definition of **Tron “special assets”** (resources plus new staking-state pseudo-assets) via `TRON_SPECIAL_ASSET_CAIP_TYPES` and a new `isTronSpecialAsset()` helper. > > Updates token lists, bridge asset selectors, and `useMultichainBalances` to filter these special assets by `assetId` so they don’t appear in user-facing pickers/lists or contribute to fiat totals, and renames the Tron-assets selector to `getAssetsBySelectedAccountGroupWithTronSpecialAssets`. > > Refreshes Tron resource handling in `useTronResources` to identify energy/bandwidth via CAIP types (ignoring other staking-state assets) and expands unit tests to cover the new filtering behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 03583ad. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 6, 2026
## **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: - Adds the new special assets that should be ignored by the selectors - Renames the variables that deal with this logic to be more inclusive of assets that are not resources (only Energy and Bandwidth are resources) [](https://codespaces.new/MetaMask/metamask-extension/pull/40540?quickstart=1) ## **Changelog** CHANGELOG entry: null ## **Related issues** Closes: [NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582), [NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584), [NEB-586](https://consensyssoftware.atlassian.net/browse/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** https://github.com/user-attachments/assets/1b4f445f-ab72-486e-a8b5-e177a33b5d8f ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [NEB-582]: https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-584]: https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-586]: https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes token/balance filtering across several UI and bridge selectors based on CAIP parsing; misclassification could hide legitimate Tron assets or affect displayed totals, though covered by new/updated tests. > > **Overview** > Adds a CAIP-based definition of **Tron “special assets”** (resources plus new staking-state pseudo-assets) via `TRON_SPECIAL_ASSET_CAIP_TYPES` and a new `isTronSpecialAsset()` helper. > > Updates token lists, bridge asset selectors, and `useMultichainBalances` to filter these special assets by `assetId` so they don’t appear in user-facing pickers/lists or contribute to fiat totals, and renames the Tron-assets selector to `getAssetsBySelectedAccountGroupWithTronSpecialAssets`. > > Refreshes Tron resource handling in `useTronResources` to identify energy/bandwidth via CAIP types (ignoring other staking-state assets) and expands unit tests to cover the new filtering behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 03583ad. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
montelaidev
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 12, 2026
## **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: - Adds the new special assets that should be ignored by the selectors - Renames the variables that deal with this logic to be more inclusive of assets that are not resources (only Energy and Bandwidth are resources) [](https://codespaces.new/MetaMask/metamask-extension/pull/40540?quickstart=1) ## **Changelog** CHANGELOG entry: null ## **Related issues** Closes: [NEB-582](https://consensyssoftware.atlassian.net/browse/NEB-582), [NEB-584](https://consensyssoftware.atlassian.net/browse/NEB-584), [NEB-586](https://consensyssoftware.atlassian.net/browse/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** https://github.com/user-attachments/assets/1b4f445f-ab72-486e-a8b5-e177a33b5d8f ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [NEB-582]: https://consensyssoftware.atlassian.net/browse/NEB-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-584]: https://consensyssoftware.atlassian.net/browse/NEB-584?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [NEB-586]: https://consensyssoftware.atlassian.net/browse/NEB-586?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes token/balance filtering across several UI and bridge selectors based on CAIP parsing; misclassification could hide legitimate Tron assets or affect displayed totals, though covered by new/updated tests. > > **Overview** > Adds a CAIP-based definition of **Tron “special assets”** (resources plus new staking-state pseudo-assets) via `TRON_SPECIAL_ASSET_CAIP_TYPES` and a new `isTronSpecialAsset()` helper. > > Updates token lists, bridge asset selectors, and `useMultichainBalances` to filter these special assets by `assetId` so they don’t appear in user-facing pickers/lists or contribute to fiat totals, and renames the Tron-assets selector to `getAssetsBySelectedAccountGroupWithTronSpecialAssets`. > > Refreshes Tron resource handling in `useTronResources` to identify energy/bandwidth via CAIP types (ignoring other staking-state assets) and expands unit tests to cover the new filtering behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 03583ad. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit 6c5902b.
Explanation
We had to revert some changes because we wanted to release a new version of the Snap without them (they need client changes to match). This PR brings those changes back by simply reverting the revert
References
Relates to: NEB-581, NEB-583, NEB-585
Checklist