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

feat: push special asset snapshots to controller - #362

Closed
ulissesferreira wants to merge 2 commits into
WPN-1497-controller-readsfrom
WPN-1497-special-assets-writes
Closed

feat: push special asset snapshots to controller#362
ulissesferreira wants to merge 2 commits into
WPN-1497-controller-readsfrom
WPN-1497-special-assets-writes

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Explanation

Stacked on: ##361 (WPN-1497-controller-reads)

This is PR 3/4 for WPN-1478.

Current state: After the read path migration (PR 2), the Snap still writes asset state locally — the controller never receives updated balances from the Snap's polling cycle.

This PR: Adds the write path: when the Snap polls the chain and detects balance changes, shouldPushSnapAssets() gates the push at stage ≥ 1, and pushAssetSnapshot() sends the full asset snapshot (all balances for an account) to AssetsController:upsertSnapAssets.

Covers all 9 Tron special assets:

  • Bandwidth (available + max)
  • Energy (available + max)
  • Staked-for-bandwidth, Staked-for-energy
  • Ready-for-withdrawal, In-lock-period, Staking-rewards

Files: 3 modified. +602 lines.

References

  • Parent: WPN-1478 (Migrate Tron Snap to consume AssetsController)
  • Sub-task: WPN-1497 (Stage 0→1, write path)
  • Blocked on Core: AssetsController:upsertSnapAssets action (WPN-1473 is read-only — a new ticket or broadening is needed)
  • Depends on Core: 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

Disables Snap asset persistence for controller-only migration stages.

Builds on WPN-1478-controller-reads-fallback.

Jira: WPN-1478
Writes grouped special Tron assets to the controller during asset synchronization.

Builds on WPN-1478-stage-gating-telemetry.

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-special-assets-writes 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