-
-
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.
feat: multiple accounts support in ledger (#10109)
## **Description** This PR will enable the multiple accounts supports for ledger devices. Following changes has been made in this PR: 1. use @metamask/eth-ledger-keyring-bridge@4.0.0 to replace old @consensys/ledgerhq-metamask-keyring@0.0.9 2. add `LedgerSelectAccount` component to allow user select multiple accounts from ledger devices. (screen is similiar to QR code select account screen) 3. add `remove accounts` for all hardware wallet accounts in `AccountActions.tsx` file. 4. add some metric logging for `remove accounts` and `connect accounts` 5. modify the `engine.ts` code and `ledger.ts` to allow intialise the new ledger keyring and its middleware and transport object. 6. Modify the `BlockingActionModel` to support `onAnimationCompleted` event so that we can have better smooth model animation than before. (very lagging animation when some heavy operations like import multiple accounts happened in the background) <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 7. What is the improvement/solution? --> ## **Related issues** Fixes: ## **Manual testing steps** **Connect Multiple Ledger accounts** 1. Launch wallet 2. Create a new account 3. Once on the wallet view, add a new account or hardware wallet 4. Add hardware wallet 5. Ledger 6. Once device is found, click Continue 7. Tick the selected Ledger accounts to be imported 8. Click Unlock **Forget Multiple Ledger accounts** 1. Use an existing wallet that has multiple Ledger accounts imported 2. Once on the wallet view, add a new account or hardware wallet 4. Add hardware wallet 5. Ledger 6. Once device is found, click 'Continue' 7. Click 'Forget this device' button 8. User will be returned to account list with all Ledger accounts removed **Forget Individual Ledger Account** 1. Use an existing wallet that has multiple Ledger accounts imported 2. Once on the wallet view, click on the three dots beside the Address section 3. Click 'Remove hardware account' 4. Click 'Remove' 5. User will be returned to account list with the individual Ledger account removed **Forget Individual QR Code Wallet Account** 1. Use an existing wallet that has multiple QR Code accounts imported 2. Once on the wallet view, click on the three dots beside the Address section 3. Click 'Remove hardware account' 4. Click 'Remove' 5. User will be returned to account list with the individual QR Code account removed ## **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** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. --------- Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com>
- Loading branch information
1 parent
70d0fcc
commit 38cf842
Showing
34 changed files
with
2,045 additions
and
564 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
// Third party dependencies. | ||
import { StyleSheet } from 'react-native'; | ||
import { fontStyles } from '../../../styles/common'; | ||
import { Colors } from '../../../util/theme/models'; | ||
|
||
/** | ||
* Style sheet function for AccountActions component. | ||
* | ||
* @returns StyleSheet object. | ||
*/ | ||
const styleSheet = () => | ||
const styleSheet = (colors: Colors) => | ||
StyleSheet.create({ | ||
actionsContainer: { | ||
alignItems: 'flex-start', | ||
justifyContent: 'center', | ||
paddingVertical: 16, | ||
}, | ||
text: { | ||
color: colors.text.default, | ||
fontSize: 14, | ||
...fontStyles.normal, | ||
}, | ||
}); | ||
|
||
export default styleSheet; |
Oops, something went wrong.