Skip to content

Commit

Permalink
fix: fix checksum address for balance check (#10135)
Browse files Browse the repository at this point in the history
## **Description**

When a user disables Batch account balance in settings, and go back to
wallet view, they should be able to still see their balance.

## **Related issues**

Fixes: #10132

## **Manual testing steps**

1. Go to Settings>Security & Privacy and disable Batch account balance
2. Go back to wallet view
3. Relaunch the app
4. Unlock the app and you should be able to see your balance correctly

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->
Check video in linked issue 🙏 

### **After**



https://github.com/MetaMask/metamask-mobile/assets/10994169/b26f20fd-d594-47ed-a689-106dd74de741



## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
sahar-fehri authored Jun 27, 2024
1 parent ea14ef7 commit f2dad68
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion patches/@metamask+assets-controllers+30.0.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,18 @@ index 8c506d9..d1ec2d2 100644
},
{}
diff --git a/node_modules/@metamask/assets-controllers/dist/chunk-V4ZO3F2S.js b/node_modules/@metamask/assets-controllers/dist/chunk-V4ZO3F2S.js
index 0430e5c..dee32be 100644
index 0430e5c..038398c 100644
--- a/node_modules/@metamask/assets-controllers/dist/chunk-V4ZO3F2S.js
+++ b/node_modules/@metamask/assets-controllers/dist/chunk-V4ZO3F2S.js
@@ -61,7 +61,7 @@ var AccountTrackerController = class extends _pollingcontroller.StaticIntervalPo
this.syncAccounts(chainId);
const { accounts, accountsByChainId } = this.state;
const isMultiAccountBalancesEnabled = this.getMultiAccountBalancesEnabled();
- const accountsToUpdate = isMultiAccountBalancesEnabled ? Object.keys(accounts) : [this.getSelectedAddress()];
+ const accountsToUpdate = isMultiAccountBalancesEnabled ? Object.keys(accounts) : [_controllerutils.toChecksumHexAddress.call(void 0, this.getSelectedAddress())];
const accountsForChain = { ...accountsByChainId[chainId] };
for (const address of accountsToUpdate) {
const balance = await this.getBalanceFromChain(address, ethQuery);
@@ -80,9 +80,11 @@ var AccountTrackerController = class extends _pollingcontroller.StaticIntervalPo
[chainId]: accountsForChain
}
Expand Down

0 comments on commit f2dad68

Please sign in to comment.