chore: remove addNewAccountWithoutUpdate#4845
Merged
mikesposito merged 6 commits intomainfrom Nov 5, 2024
Merged
Conversation
cryptodev-2s
previously approved these changes
Oct 24, 2024
gantunesr
approved these changes
Nov 5, 2024
This was referenced Nov 15, 2024
7 tasks
github-merge-queue bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 27, 2024
…8.0.0 (#12339) ## **Description** This PR updates the accounts controller to the latest version of 19. This updates requires a peer dependancy bump of the keyring controller to version 18.0.0 - See accounts controller [changelog](https://github.com/MetaMask/core/blob/main/packages/accounts-controller/CHANGELOG.md#1900). - See keyring controller [changelog](https://github.com/MetaMask/core/blob/main/packages/keyring-controller/CHANGELOG.md#1800). - version 18 of the keyring controller removes the [addNewAccountWithoutUpdate](MetaMask/core#4845) which is used once in the mobile repo. In order to merge this PR we will need to wait for @mikesposito's [PR to merge](#11409). This PR removes the need for `addNewAccountWithoutUpdate` and improves performance/reliability. ## **Related issues** Fixes: #12302 Fixes: #12304 Unblocked by: #11409 ## **Manual testing steps** #### Account creation 1. open app 2. press create wallet 3. go through the onboarding flow 4. once onboarding is complete, you should be on the wallet view and see a single account 5. open the account selector list and add a new account' 6. this should work without issues 7. change the name of your new account 8. force close the app and reopen, the previously selected account should be the same and the custom name should be preserved. #### Account importing 1. assuming you have created a wallet wth the above steps.... 2. open the account selector list and click add account or hardware wallet and then click import account 3. paste a private key in this text field and then import 4. the account should be imported, selected and have the label "imported" 5. force closing the app and re opening it should preserve the same state of accounts #### Hardware wallets 1. assuming you have created a wallet wth the above steps.... 2. open the account selector list and click add account or hardware wallet and then click Add hardware wallet 3. select your hardware wallet of choice (ledger or qr based) 4. follow the instructions to add a hardware wallet 5. the steps should work and you should have successfully added a hardware account 6. the hardware account should have the correct labels (either Qr hardware or ledger) 7. force closing the app and reopening should preserve the same accounts state. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/ab8ca48e-dc48-4601-a56c-5c6d7fabab3e ## **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.
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.
Explanation
As updating identities in clients isn't a
KeyringControllerresponsibility anymore, theaddNewAccountWithoutUpdatehas no reason to exist here.This method is currently used in one place, and there is an open PR to remove it.
References
addAccountWithoutUpdatenow updates thePreferencesControllerstate #3848Changelog
@metamask/keyring-controlleraddNewAccountWithoutUpdateChecklist