-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
fix: token detection during account change #4133
Merged
bergeron
merged 3 commits into
main
from
brian/token-detect-on-mainnet-when-setting-off3
Apr 3, 2024
Merged
fix: token detection during account change #4133
bergeron
merged 3 commits into
main
from
brian/token-detect-on-mainnet-when-setting-off3
Apr 3, 2024
Conversation
This file contains 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
3 tasks
bergeron
changed the title
Brian/token detect on mainnet when setting off3
fix: token detection during account change
Apr 3, 2024
7 tasks
MajorLift
approved these changes
Apr 3, 2024
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.
LGTM!
salimtb
approved these changes
Apr 3, 2024
bergeron
added a commit
to MetaMask/metamask-extension
that referenced
this pull request
Apr 5, 2024
## **Description** Fixes issues with detecting and manually importing tokens, caused by recent controller changes. Hotfix for 11.14.0 This state publish had an undefined variable, and had the wrong function signature: <img width="597" alt="Screenshot 2024-03-28 at 6 04 41 PM" src="https://github.com/MetaMask/metamask-extension/assets/3500406/15cd8341-725b-49d8-bd4d-bf8539185214"> Which prevented the controllers from processing account switches. A test was failing because RPC requests were sent before onboarding. Delayed the enabling of token detection controller to `triggerNetworkrequests`. Also patching this fix for detection during account switch on mainnet when autodetection=off: MetaMask/core#4133 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/23798?quickstart=1) ## **Related issues** Fixes: - #23526 - #23612 ## **Manual testing steps** ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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-extension/blob/develop/.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.
bergeron
added a commit
to MetaMask/metamask-extension
that referenced
this pull request
Apr 5, 2024
## **Description** Fixes issues with detecting and manually importing tokens, caused by recent controller changes. Hotfix for 11.14.0 This state publish had an undefined variable, and had the wrong function signature: <img width="597" alt="Screenshot 2024-03-28 at 6 04 41 PM" src="https://github.com/MetaMask/metamask-extension/assets/3500406/15cd8341-725b-49d8-bd4d-bf8539185214"> Which prevented the controllers from processing account switches. A test was failing because RPC requests were sent before onboarding. Delayed the enabling of token detection controller to `triggerNetworkrequests`. Also patching this fix for detection during account switch on mainnet when autodetection=off: MetaMask/core#4133 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/23798?quickstart=1) ## **Related issues** Fixes: - #23526 - #23612 ## **Manual testing steps** ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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-extension/blob/develop/.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.
montelaidev
added a commit
that referenced
this pull request
Apr 17, 2024
## Explanation ## References ## Changelog ## [13.0.0] Accounts Controller ### Changed - Fix update setSelectedAccount to throw if the id is not found ([#4167](#4167)) - Fix normal account indexing naming with index gap ([#4089](#4089)) - **BREAKING** Bump peer dependency `@metamask/snaps-controllers` to `^6.0.3` and dependencies `@metamask/snaps-sdk` to `^3.1.1`, `@metamask/eth-snap-keyring` to `^3.0.0`([#4090](#4090)) ## [28.0.0] Assets Controller ### Added - Add reservoir migration ([#4030](#4030)) ### Changed - Fix getting nft tokenURI ([#4136](#4136)) - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` ([#4090](#4090)) - Fix token detection during account change ([#4133](#4133)) - Fix update nft metadata when toggles off ([#4096](#4096)) - Adds `tokenMethodIncreaseAllowance` ([#4069](#4069)) - Fix mantle token mispriced ([#4045](#4045)) ## [15.0.0] Keyring Controller ### Changed - **BREAKING** use getAccounts on HD Keyring when calling addNewAccount ([#4158](#4158)) - Pass CAIP-2 scope to execution context ([#4090](#4090)) - Allow gas limits to be changed during #addPaymasterData ([#3942](#3942)) ## [10.0.0] Preferences Controller ### Changed - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` to `^15.0.0` ([#4090](#4090)) - Restore previous behavior of toChecksumHexAddress ([#4046](#4046)) ## [15.0.0] Signature Controller ### Changed - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` to `^15.0.0` ([#4090](#4090)) ## [8.0.0] User Operation Controller ### Changed - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` to `^15.0.0` and Pass CAIP-2 scope to execution context ([#4090](#4090)) - Allow gas limits to be changed during #addPaymasterData ([#3942](#3942)) ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate
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.
Explanation
During account change, the token detection trigger was guarded by the
useTokenDetection
setting. But on mainnet, detection should run against the static token list even if the setting is disabled. So remove the guard.References
MetaMask/metamask-extension#23798
Changelog
@metamask/assets-controllers
Checklist