Repository navigation
Conversation
The core keeps a disabled token's last balance in wallet.balanceMap, and the total summed every entry in that map. Disabling a token therefore left its value in the Total Balance, which BalanceCard and the recovery reminder both read. Skip token ids missing from wallet.enabledTokenIds.
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.
Description
Asana task
Total Balance summed every entry in
wallet.balanceMap. The core keeps a disabled token's last balance in that map, and the account cache seeds it back at login. A disabled token therefore kept counting toward the total, and relogging did not clear it.getTotalFiatAmountFromExchangeRatesnow skips any token that is not inwallet.enabledTokenIds. The mainnet asset (tokenId == null) still counts. The other caller,RecoveryReminderActions, gets the same corrected total.The size of the bad number in the report comes from a separate defect: the builtin USDS entry in edge-currency-accountbased lists 6 decimals instead of 18. That fix is in its own PR and reaches the app through a dependency bump. This PR passes standalone and does not depend on it.
Keys-only wallets counting toward the total is a separate task and is not changed here.
Simulator results, Home Total Balance on the agent account holding 11.978 USDS:
Repeating the toggle in one flow read $195.60, $183.66, $195.63, $183.55 for enabled, disabled, enabled, disabled.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Test evidence
c74a656Exclude disabled tokens from Total Balance
2026-11-02
4. total balance with usds enabled
5. total balance after disabling usds
6. control develop code counts disabled usds
7. develop code inflated with usds disabled and cached
8. develop code correct with account cache removed
9. fix correct with usds disabled and cached
10. flow total with usds enabled
11. flow total after disabling usds
12. flow total after re enabling usds
13. flow total after disabling usds again