fix: balance stuck in loading state.#17372
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…obile into fix/balances-bitcoin
There was a problem hiding this comment.
Bug: Native Token Balance Overwrite Bug
The getMultichainNetworkAggregatedBalance function processes all assets for an account. If an account holds native assets from multiple chains (e.g., Bitcoin and Solana), the totalNativeTokenBalance is repeatedly overwritten during asset iteration. This causes only the balance of the last native asset processed to be retained, leading to data loss and non-deterministic, incorrect native token balance reporting.
app/selectors/multichain/multichain.ts#L292-L314
metamask-mobile/app/selectors/multichain/multichain.ts
Lines 292 to 314 in ce55051
Was this report helpful? Give feedback by reacting with 👍 or 👎
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17372 +/- ##
==========================================
+ Coverage 73.57% 73.77% +0.20%
==========================================
Files 2845 2852 +7
Lines 63338 63814 +476
Branches 10328 10445 +117
==========================================
+ Hits 46598 47076 +478
+ Misses 13741 13707 -34
- Partials 2999 3031 +32 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|



Description
Fixes bug where native balances are not displayed for non EVM accounts on the accounts list because we try fetching the balance of the current selected network instead of the network of the account.
Changelog
CHANGELOG entry: Fixes bug where native balances are not displayed for non EVM accounts on the accounts list
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/NWNT-408
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist