Skip to content

chore(runway): cherry-pick fix(tron): special assets not being identified correctly - #34820

Merged
sleepytanya merged 2 commits into
release/8.8.0from
runway-cherry-pick-8.8.0-1786721667
Aug 14, 2026
Merged

chore(runway): cherry-pick fix(tron): special assets not being identified correctly#34820
sleepytanya merged 2 commits into
release/8.8.0from
runway-cherry-pick-8.8.0-1786721667

Conversation

@runway-github

@runway-github runway-github Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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

Manual testing steps

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

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

    to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production
    performance metrics
  • See trace() for usage and
    addToken
    for an example

For performance guidelines and tooling, see the Performance
Guide
.

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.

Co-authored-by: Cursor Agent cursoragent@cursor.com 65fae6e

…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>
@runway-github
runway-github Bot requested review from a team as code owners August 14, 2026 15:34
@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamask-ci metamask-ci Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Aug 14, 2026
@github-actions github-actions Bot added size-M risk:medium AI analysis: medium risk labels Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeConfirmations, SmokeNetworkExpansion
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR refactors Tron special asset identification from symbol-based matching to CAIP-19 ID-based matching across several critical files:

  1. constants.ts: Replaces TRON_SPECIAL_ASSET_SYMBOLS object with KnownCaip19Id enum and TRON_SPECIAL_ASSET_IDS_SET. The CAIP-19 IDs also changed (e.g., 'strx-energy' → '195-staked-for-energy', 'max-energy' → 'maximum-energy').

  2. utils.ts: isTronSpecialAsset signature changed from (chainId, symbol) to (assetId) - now matches by full CAIP-19 asset ID.

  3. assets-list.ts: Multiple asset list selectors updated to use asset.assetId instead of (asset.chainId, asset.symbol) for Tron special asset filtering. This affects what tokens appear in the main wallet token list.

  4. multichain.ts: selectAccountTokensAcrossChainsUnified updated to use new signature, affecting cross-chain token display.

  5. Bridge/isTradableToken: Updated to use token.address (which stores CAIP-19 ID for non-EVM tokens) instead of (token.chainId, token.symbol). This directly affects which tokens appear in Bridge/Swap token selection.

Tag Rationale:

  • SmokeSwap: isTradableToken in Bridge is directly changed, affecting which tokens appear in swap/bridge flows. Tron tokens could incorrectly appear or be filtered.
  • SmokeStake: Tron staking assets (energy, bandwidth, staked TRX) are the primary subject of this refactoring. The Earn/Tron components import from assets-list.ts.
  • SmokeWalletPlatform: Asset list display (token list) is affected by the selector changes - Tron special assets may appear/disappear incorrectly in the main wallet view.
  • SmokeConfirmations: Required as a dependent tag when selecting SmokeSwap and SmokeStake.
  • SmokeNetworkExpansion: Non-EVM (Tron) multichain support is directly affected by the CAIP-19 ID changes in the multichain selectors.

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:
The changes are a refactoring of Tron special asset identification logic (symbol-based to CAIP-19 ID-based). While this affects asset list selectors, the changes are filtering logic improvements that don't introduce new rendering complexity or performance-sensitive operations. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@sleepytanya
sleepytanya enabled auto-merge (squash) August 14, 2026 22:18
@sleepytanya
sleepytanya disabled auto-merge August 14, 2026 22:18
@sleepytanya
sleepytanya enabled auto-merge (squash) August 14, 2026 22:19
@sleepytanya
sleepytanya disabled auto-merge August 14, 2026 22:19
@sleepytanya
sleepytanya merged commit ff93bb5 into release/8.8.0 Aug 14, 2026
91 of 93 checks passed
@sleepytanya
sleepytanya deleted the runway-cherry-pick-8.8.0-1786721667 branch August 14, 2026 22:19
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk:medium AI analysis: medium risk size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants