-
-
Notifications
You must be signed in to change notification settings - Fork 252
feat: changes to AccountTrackerController to enable migration in extension #6938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
63ea58a to
561d671
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
| tokenBalances: { | ||
| '0x0000000000000000000000000000000000000000': { | ||
| [CHECKSUM_ADDRESS_1]: new BN('123456', 16), | ||
| [ADDRESS_1]: new BN('123456', 16), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salimtb I'd like your input here if possible.
From what I can see, if we use multicall (queryAllAccounts: true), the resulting addresses will be lowercase, but when we query a single address (queryAllAccounts: false) the result is a checksummed address.
Therefore, since I have changed the these two events to query multiple accounts (both the from and the to), I had to change this return value from the test.
Does that sound right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sounds right yes
|
@metamaskbot publish-preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
| | { | ||
| type: 'PreferencesController:getState'; | ||
| handler: () => { isMultiAccountBalancesEnabled: boolean }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes type issues in clients, as the extension PreferencesController state is not compatible with core. We only care about isMultiAccountBalancesEnabled.
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Explanation
Adds optional callback to disable fetching balances in AccountTrackerController.
Attempts to refresh balance when a network is added and when the keyring is unlocked.
References
Checklist
Note
Adds optional fetchingEnabled gate, refreshes on networkAdded/unlock, and updates tx handlers to refresh both from/to addresses via new refreshAddresses; updates tests and changelog with breaking notes.
fetchingEnabledconstructor callback;refreshshort-circuits when disabled.NetworkController:networkAddedandKeyringController:unlockto trigger balance refreshes.fromandtovia newrefreshAddresses; remove single-address refresh path.PreferencesController:getStatetyping; remove legacyAccountsController:selectedAccountChangereference.networkAdded,unlock, and disabled fetching; address checksum fixes.fetchingEnabledoption.Written by Cursor Bugbot for commit 878ed7e. This will update automatically on new commits. Configure here.