Skip to content

refactor(tron-wallet-snap): organize handlers and rename asset reader functions - #90

Merged
ulissesferreira merged 7 commits into
mainfrom
WPN-1497-handlers-and-renames
Aug 3, 2026
Merged

refactor(tron-wallet-snap): organize handlers and rename asset reader functions#90
ulissesferreira merged 7 commits into
mainfrom
WPN-1497-handlers-and-renames

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move handlers into dedicated folders (handlers/assets/, cronjob/, keyring/, user-input/) with explicit import paths
Old New
Screenshot 2026-07-31 at 22 41 37 Screenshot 2026-07-31 at 22 40 24
Screenshot 2026-08-03 at 13 15 16
  • Rename AssetsService account readers: getAccountAssets, getAccountAssetsByIDs, getAccountAssetByID
  • No runtime behavior change

Jira

Test plan

  • yarn workspace @metamask/tron-wallet-snap build
  • yarn workspace @metamask/tron-wallet-snap run test

Part of the AssetsController migration split stack (Step 1/3).

@ulissesferreira
ulissesferreira requested a review from a team as a code owner July 31, 2026 21:37
@ulissesferreira
ulissesferreira requested a review from a team as a code owner July 31, 2026 21:48
@ulissesferreira ulissesferreira changed the title refactor(tron-wallet-snap): organize handlers and rename asset readers (WPN-1497) refactor(tron-wallet-snap): organize handlers and rename asset reader functions Jul 31, 2026
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-handlers-and-renames branch from 2960d5a to 414cba1 Compare August 2, 2026 20:48
@ulissesferreira
ulissesferreira changed the base branch from main to WPN-1784-shared-assets-service August 2, 2026 20:48
@socket-security

socket-security Bot commented Aug 2, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

Pure organizational move with import path updates only. No AssetsService
API renames or behavior changes.
Align public reader names with the final AssetsController-oriented API:
getAccountAssets, getAccountAssetsByIDs, getAccountAssetByID.
Handler folder move requires importing from ../cronjob/cronjob rather
than the bare folder path so the Snap bundle resolves correctly.
Handler files moved into subfolders in WPN-1497, so point eslint
suppressions at the new paths and refresh snap.manifest.json after
the handler import path fix changed the bundle hash.
@ulissesferreira
ulissesferreira changed the base branch from WPN-1784-shared-assets-service to main August 2, 2026 23:20
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-handlers-and-renames branch from 414cba1 to 0e17e41 Compare August 2, 2026 23:20
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@cursoragent resolve these conflicts

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Merge conflicts are resolved on WPN-1497-handlers-and-renames.

What conflicted: Only packages/tron-wallet-snap/snap.manifest.json — a shasum mismatch between this branch and main.

What I did:

  1. Merged origin/main into the branch
  2. Resolved the manifest conflict by rebuilding the snap (ENVIRONMENT=production with .env.example values)
  3. The build updated the shasum to 9vYQY+HG5oHsXriNEPUWw2FbLO/b4iKuf8IsUIE4QtM=
  4. Verified tests pass locally
  5. Committed and pushed the merge (10081da4)

main is now fully merged into this branch, so the PR should no longer show conflicts. CI will re-run on the new commit.

Open in Web Open in Cursor 

Resolve snap.manifest.json shasum conflict by rebuilding after merge.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@cursoragent now there are linting problems. fix those but make sure that doesn't introduce the same shasum problem

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

The CI failures weren’t ESLint issues — all lint jobs passed. The Build and Test jobs failed because snap.manifest.json had the wrong shasum, leaving the working tree dirty after yarn build.

Root cause: The merge-resolution build used local .env.example URLs, but CI builds with ENVIRONMENT=production and GitHub Actions secrets for mainnet RPC URLs. Those produce a different bundle hash:

Source Shasum
Local build (.env.example) 9vYQY+HG5oHsXriNEPUWw2FbLO/b4iKuf8IsUIE4QtM=
CI production build 0E86PeuwFcabw+zj98vn+O/XML6E9aDeng1o7+Qq47s=

Fix: Updated the manifest to the CI-reported shasum (0E86PeuwFcabw+zj98vn+O/XML6E9aDeng1o7+Qq47s=) without running a local production build, so we don’t overwrite it with the wrong value again.

Verified yarn lint still passes and doesn’t touch the manifest. Pushed in f7323ec4 — CI should pass once it re-runs.

Open in Web Open in Cursor 

…build

The previous shasum was computed locally with .env.example URLs, which
differs from the CI production environment secrets. Use the shasum
reported by the CI build job to keep the working tree clean.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>

@taran-a taran-a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. GG.

Part of the AssetsController migration split stack (Step 1/3).

@ulissesferreira ^^ this is nice. I don't know if you have plans to also add links for the following PRs (would be nice imo), but the idea of stacks is really nice. We might even consider some template for such PRs if we are going to use stacks later.

@ulissesferreira
ulissesferreira added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit d153bee Aug 3, 2026
46 checks passed
@ulissesferreira
ulissesferreira deleted the WPN-1497-handlers-and-renames branch August 3, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants