Skip to content

chore: remove addNewAccountWithoutUpdate#4845

Merged
mikesposito merged 6 commits intomainfrom
mikesposito/chore/remove-keyringcontroller-method
Nov 5, 2024
Merged

chore: remove addNewAccountWithoutUpdate#4845
mikesposito merged 6 commits intomainfrom
mikesposito/chore/remove-keyringcontroller-method

Conversation

@mikesposito
Copy link
Member

@mikesposito mikesposito commented Oct 24, 2024

Explanation

As updating identities in clients isn't a KeyringController responsibility anymore, the addNewAccountWithoutUpdate has no reason to exist here.

This method is currently used in one place, and there is an open PR to remove it.

References

Changelog

@metamask/keyring-controller

  • BREAKING: Remove addNewAccountWithoutUpdate

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
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@mikesposito mikesposito added the team-wallet-framework Deprecated: Please use `team-core-platform` instead. label Oct 24, 2024
@mikesposito mikesposito marked this pull request as ready for review October 24, 2024 12:35
@mikesposito mikesposito requested review from a team as code owners October 24, 2024 12:35
cryptodev-2s
cryptodev-2s previously approved these changes Oct 24, 2024
@desi desi requested a review from a team October 25, 2024 20:46
@mikesposito mikesposito merged commit 5f6b020 into main Nov 5, 2024
@mikesposito mikesposito deleted the mikesposito/chore/remove-keyringcontroller-method branch November 5, 2024 13:35
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-wallet-framework Deprecated: Please use `team-core-platform` instead.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants