chore(runway): cherry-pick fix(tron): special assets not being identified correctly - #34820
Conversation
…fied correctly cp-8.8.0 (#34801) ## **Description** Tron special assets (staked TRX, energy, bandwidth, and staking lifecycle) were identified by **symbol** (`strx-energy`, `max-energy`, and similar). After the Assets Controller migration those values live under stable CAIP-19 IDs (for example `slip44:195-staked-for-energy` and `slip44:maximum-energy`), so the lookups never matched. That left the TRX token detail page without a staked balance, and showed incorrect energy and bandwidth values, even though controller state was correct. This change identifies special assets by CAIP-19 ID only (`KnownCaip19Id` / `TRON_SPECIAL_ASSET_IDS_SET`), using the same grouping pattern as the old symbol list. ## **Changelog** CHANGELOG entry: Fixed Tron staked TRX, energy, and bandwidth not displaying correctly on token details ## **Related issues** Fixes: [WPN-1854](https://consensyssoftware.atlassian.net/browse/WPN-1854) ## **Manual testing steps** ```gherkin Feature: Tron special assets on token details Scenario: user opens TRX token details with staked TRX Given a Tron account with TRX staked for energy or bandwidth When the user opens the TRX token detail page Then the staked TRX balance is shown And stake and unstake actions are available And energy and bandwidth values match controller state ``` ## **Screenshots/Recordings** ### **Before** N/A — screenshots to be added after manual verification on device. ### **After** N/A — screenshots to be added after manual verification on device. ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **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. [WPN-1854]: https://consensyssoftware.atlassian.net/browse/WPN-1854?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: Cursor Agent <cursoragent@cursor.com>
|
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 detailsE2E Test Selection:
Tag Rationale:
The changes are a refactoring that changes the matching logic (symbol → CAIP-19 ID), which could cause regressions if any CAIP-19 IDs don't match what the AssetsController provides. Performance Test Selection: |
|



Description
Tron special assets (staked TRX, energy, bandwidth, and staking
lifecycle) were identified by symbol (
strx-energy,max-energy,and similar). After the Assets Controller migration those values live
under stable CAIP-19 IDs (for example
slip44:195-staked-for-energyandslip44:maximum-energy), so the lookups never matched.That left the TRX token detail page without a staked balance, and showed
incorrect energy and bandwidth values, even though controller state was
correct.
This change identifies special assets by CAIP-19 ID only
(
KnownCaip19Id/TRON_SPECIAL_ASSET_IDS_SET), using the samegrouping pattern as the old symbol list.
Changelog
CHANGELOG entry: Fixed Tron staked TRX, energy, and bandwidth not
displaying correctly on token details
Related issues
Fixes:
WPN-1854
Manual testing steps
Screenshots/Recordings
Before
N/A — screenshots to be added after manual verification on device.
After
N/A — screenshots to be added after manual verification on device.
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Co-authored-by: Cursor Agent cursoragent@cursor.com 65fae6e