Skip to content

fix(tron-wallet-snap): distinguish inactive accounts from HTTP failures on fetchAssetsAndBalancesForAccount - #151

Merged
ulissesferreira merged 1 commit into
mainfrom
fix/core-assets-adapter-check-rejection-reason
Aug 18, 2026
Merged

fix(tron-wallet-snap): distinguish inactive accounts from HTTP failures on fetchAssetsAndBalancesForAccount#151
ulissesferreira merged 1 commit into
mainfrom
fix/core-assets-adapter-check-rejection-reason

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to Stanley's review on feat(tron-wallet-snap): add CoreAssetsAdapter and mapControllerAsset #144: inspect Promise.allSettled rejection reason in CoreAssetsAdapter.fetchAssetsAndBalancesForAccount.
  • Treat only TrongridAccountNotFoundError as an inactive account; rethrow HTTP and other unexpected failures from account info, resources, and staking rewards instead of reporting zero balances.

Test plan

  • Confirm inactive accounts (TrongridAccountNotFoundError) still return zero snap-owned assets
  • Confirm a TrongridHttpError from account info fails the fetch instead of looking like an inactive account
  • Confirm HTTP failures from getAccountResources / getReward also fail the fetch
  • yarn workspace @metamask/tron-wallet-snap run test (or check-tron)

@ulissesferreira
ulissesferreira requested a review from a team as a code owner August 14, 2026 14:09
@ulissesferreira
ulissesferreira deployed to default-branch August 14, 2026 14:09 — with GitHub Actions Active
@ulissesferreira
ulissesferreira force-pushed the fix/core-assets-adapter-check-rejection-reason branch from ffba7d0 to 8cc6f10 Compare August 14, 2026 14:19
@ulissesferreira
ulissesferreira force-pushed the fix/core-assets-adapter-check-rejection-reason branch from 8cc6f10 to 68dea61 Compare August 14, 2026 14:21
@ulissesferreira
ulissesferreira force-pushed the fix/core-assets-adapter-check-rejection-reason branch from 68dea61 to bc18ebd Compare August 14, 2026 14:28
@ulissesferreira ulissesferreira changed the title fix(tron-wallet-snap): distinguish inactive accounts from HTTP failures fix(tron-wallet-snap): distinguish inactive accounts from HTTP failures on fetchAssetsAndBalancesForAccount Aug 14, 2026
@ulissesferreira
ulissesferreira force-pushed the fix/core-assets-adapter-check-rejection-reason branch from bc18ebd to 61a6817 Compare August 14, 2026 14:33

@stanleyyconsensys stanleyyconsensys 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.

thx for the work, Looks great to me

i assume you already have some place to catch and trace the error

just question, since u dont throw error when acc is not found,
can we assume addressResourcesRequest and addressStakingRewardsRequest will not throw error if account not found?

@ulissesferreira

Copy link
Copy Markdown
Contributor Author

thx for the work, Looks great to me

i assume you already have some place to catch and trace the error

just question, since u dont throw error when acc is not found, can we assume addressResourcesRequest and addressStakingRewardsRequest will not throw error if account not found?

Yes we can, they basically just return empty

@ulissesferreira
ulissesferreira added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit e54c378 Aug 18, 2026
49 checks passed
@ulissesferreira
ulissesferreira deleted the fix/core-assets-adapter-check-rejection-reason branch August 18, 2026 08:47
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.

2 participants