-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#9724) ## **Description** 1. What is the reason for the change? In an effort to make MetaMask multi chain we are migrating from an address based accounts to account id based account. In #8759 previous PR we integrated the accounts controller which stores metadata like the account name, address and supported methods. This pr migrates all the use of `selectIdentities` to use the accounts controller as the source of truth for all accounts information (address, name etc). 2. What is the improvement/solution? - find all use of `selectIdentities` and replace it with `selectInternalAccounts` and/or `selectSelectedInternalAccountChecksummedAddress` - These selectors are already in use in `main` and are defined [here](https://github.com/MetaMask/metamask-mobile/blob/main/app/selectors/accountsController.ts#L11-L32). - tests for these utils can be found [here](https://github.com/MetaMask/metamask-mobile/blob/main/app/selectors/accountsController.test.ts#L86). - Note that ENS resolution in the send flow is not working but has been broken in production for a while. ENS resolution in the accounts list and dapp transactions are working as expected. ## **Related issues** Fixes: MetaMask/accounts-planning#410 ## Q.A/Review check list - [QA builds](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a4fca9c3-11d5-4654-80ce-4cdedd638fe6?tab=artifacts) - [ ] Verify that there is no use of `selectIdentities` in the app - [ ] Verify that no functions are expecting `identities` as params ## **Manual testing steps** #### Fresh install 1. Launch wallet 2. create a new account 4. once on the wallet view, add a new account 5. create a custom name for your account(s) 6. swipe away the app and re open 7. login 8. the selected account should be same one that was previously selected 9. all addresses should be in [checksum format](https://coincodex.com/article/2078/ethereum-address-checksum-explained/) 10. connect the portfolio dapp via the portfolio button on the home screen. 11. Click connect on the portfolio dapp 12. The first address in the address picker should be match the selected address on the wallet view and be in checksum format #### Upgrade path 1. Use an existing wallet that has multiple accounts created/imported 2. Change the names of your accounts so that they have custom names 3. "upgrade" your wallet to this branch 4. the selected account should be the same as it was on the previous branch 5. all of the account data should remain the same (names and balances) #### Send flow 1. Start a send transaction 2. Verify that the account names and addresses are consistent in the relevant screens of the flow #### Hardware wallet connection and confirmation 1. Connect a hardware wallet device 2. Go to the MetaMask test dapp and try to connect an account 3. Verify that the account names and addresses are consistent ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **After** #### Basic usage https://github.com/MetaMask/metamask-mobile/assets/22918444/c5df59e1-05e6-43de-9efd-9a479aa342f7 #### Hardware account name preserved when connecting and confirming with dapps https://github.com/MetaMask/metamask-mobile/assets/22918444/2931b041-7e69-43ff-acb1-c4405e5b526b #### Complex usage - Ledger account connected - Imported account with ens (orangefox.eth) - custom account name - derived account - Tested.... - send flow has the correct names ✅ - wallet list has the correct names, even after a force reload (and correct selected account) ✅ - dapp connection request has the correct names for all accounts including hardware and ENS account ✅ - dapp transactions have correct names for all account types https://github.com/MetaMask/metamask-mobile/assets/22918444/254aeb44-6301-463e-86b6-01a12d56d967 ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask 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
1 parent
25e9079
commit 466f57c
Showing
56 changed files
with
1,141 additions
and
1,127 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.