Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

feat: read Tron assets from controller with fallback - #361

Closed
ulissesferreira wants to merge 2 commits into
WPN-1497-migration-foundationfrom
WPN-1497-controller-reads
Closed

feat: read Tron assets from controller with fallback#361
ulissesferreira wants to merge 2 commits into
WPN-1497-migration-foundationfrom
WPN-1497-controller-reads

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Explanation

Stacked on: ##360 (WPN-1497-migration-foundation)

This is PR 2/4 for WPN-1478.

Current state: The Snap reads assets from local state exclusively. Asset queries (balance checks, fee computation, send validation) never touch the AssetsController.

This PR: Routes all 11 asset read sites through getAssetForStage(), a 4-stage switch that encodes the full rollout:

  • Stage 0 (Off): local state only (current behavior)
  • Stage 1 (ReadAssetsControllerWithFallback): controller first, fall back to Snap state
  • Stage 2 (ReadAssetsControllerWithoutFallback): controller only, throw if missing
  • Stage 3 (ReadAssetsControllerOnly): same as stage 2

Also introduces buildControllerSnapshot() for initial sync and gates KeyringEvents on stage < 3 (events fire through stage 2 for rollback safety, per the Jira spec).

Files: 8 modified. +411 lines.

References

  • Parent: WPN-1478 (Migrate Tron Snap to consume AssetsController)
  • Sub-task: WPN-1497 (Stage 0→1)
  • WPN-1498 (Stage 1→2, config-only advance) behavior already encoded in the stage switch
  • Depends on Core: WPN-1473, WPN-1489, WPN-1490

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Routes transaction and confirmation asset reads through the staged controller adapter.

Builds on WPN-1478-migration-foundation.

Jira: WPN-1478
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

Tentative approach under old ASSETS-2 shape — superseded by WPN-1478 redesign.

@ulissesferreira
ulissesferreira deleted the WPN-1497-controller-reads branch July 24, 2026 18:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant