refactor(tron-wallet-snap): extract shared asset utils and inject SnapAssetsAdapter - #143
Merged
ulissesferreira merged 5 commits intoAug 10, 2026
Merged
Conversation
…pAssetsAdapter Move snap-owned extraction helpers into shared utils, wire SnapAssetsAdapter from context into AssetsService, and rename getByKeyringAccountId to getAccountAssets.
ulissesferreira
temporarily deployed
to
default-branch
August 10, 2026 14:13 — with
GitHub Actions
Inactive
This was referenced Aug 10, 2026
This was referenced Aug 10, 2026
ulissesferreira
commented
Aug 10, 2026
Contributor
Author
There was a problem hiding this comment.
Simple rename, will come in handy
ulissesferreira
commented
Aug 10, 2026
Contributor
Author
There was a problem hiding this comment.
Simple rename, will come in handy
ulissesferreira
commented
Aug 10, 2026
Contributor
Author
There was a problem hiding this comment.
This functions will be reused in the future so let's extract them to a utils
ulissesferreira
commented
Aug 10, 2026
Contributor
Author
There was a problem hiding this comment.
Adapters should not be initialized in the service but rather passed in
…om CI Apply oxfmt to extracted asset utils and set snap.manifest.json shasum to the Linux CI build output so the build job's clean-working-tree check passes.
Satisfy import-x/consistent-type-specifier-style for CI eslint.
taran-a
reviewed
Aug 10, 2026
taran-a
reviewed
Aug 10, 2026
taran-a
reviewed
Aug 10, 2026
taran-a
left a comment
Contributor
There was a problem hiding this comment.
GG. LGTM, just a couple of comment regarding types
Use CaipAssetType for the snap-owned asset set and lookup parameter per review feedback.
ulissesferreira
enabled auto-merge
August 10, 2026 16:13
taran-a
approved these changes
Aug 10, 2026
ulissesferreira
deleted the
WPN-1497-extract-shared-asset-util-functions
branch
August 10, 2026 16:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build*,extract*,isSnapOwnedAsset) into sharedservices/assets/utilsand teachSnapAssetsAdapterto use themSnapAssetsAdapterincontext.tsand inject it intoAssetsServicegetByKeyringAccountId→getAccountAssets(essential-asset synthesis included) and update keyring callersPart of WPN-1497. Stack:
Test plan
yarn workspace @metamask/tron-wallet-snap run buildyarn workspace @metamask/tron-wallet-snap run jest --no-coverage src/services/assets/AssetsService.test.ts src/services/assets/utils/isSnapOwnedAsset.test.ts src/handlers/keyring/keyring.test.ts