-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Update @metamask/eth-keyring-controller
#1441
Conversation
Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: @metamask/[email protected], @metamask/[email protected], [email protected] |
) { | ||
const messageParamsClone = { ...messageParams }; | ||
|
||
if ((await this.getAccountKeyringType(address)) === KeyringTypes.qr) { |
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.
Starting from @metamask/[email protected]
any attempt to add a Keyring of a type with a missing keyring builder throws an error instead of returning undefined.
Seems like this behavior is changed in |
a1e7c65
to
9cc3f57
Compare
Update of |
95242fc
to
13a2ec7
Compare
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
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.
Looks good! Just spotted some typecasting and had some questions.
|
0ff5406
to
a1ff4d4
Compare
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.
Looked over these changes and they make sense to me.
Would it be worth it to list these in the changelog as well?
Also you had listed that the |
4ac5946
to
62e1617
Compare
* chore: update eth-keyring-controller * fix: update airgapped keyring and fix deserialize issue * refactor: leave better comment * chore: use eth-keyring-controller v12 * refactor: use latest @metamask/utils * chore: fix lint * chore: yarn dedupe * chore: add obs-store module declaration * refactor: remove cacheEncryptionKey from default test parameters * refactor: apply @mcmire suggestions * refactor remove unnecessary typecast * refactor: simplify keyring builders type * refactor: remove qr assertion * refactor: use @metamask/eth-keyring-controller v13 * refactor: remove obs-store module declaration * refactor: remove unnecessary code * refactor: addQRKeyring as hash function * refactor: #addQRKeyring reorder with other prv methods * refactor: apply @Gudahtt suggestions
* chore: update eth-keyring-controller * fix: update airgapped keyring and fix deserialize issue * refactor: leave better comment * chore: use eth-keyring-controller v12 * refactor: use latest @metamask/utils * chore: fix lint * chore: yarn dedupe * chore: add obs-store module declaration * refactor: remove cacheEncryptionKey from default test parameters * refactor: apply @mcmire suggestions * refactor remove unnecessary typecast * refactor: simplify keyring builders type * refactor: remove qr assertion * refactor: use @metamask/eth-keyring-controller v13 * refactor: remove obs-store module declaration * refactor: remove unnecessary code * refactor: addQRKeyring as hash function * refactor: #addQRKeyring reorder with other prv methods * refactor: apply @Gudahtt suggestions
## **Description** This PR bumps the `@metamask/keyring-controller` version from `6.0.0` to `7.5.0`. These are the relevant changes to take into consideration during review, - **BREAKING**: Remove `keyringTypes` property from the KeyringController state ([#1441](MetaMask/core#1441)) - **BREAKING**: Constructor `KeyringControllerOptions` type changed ([#1441](MetaMask/core#1441)) - The `KeyringControllerOptions.state` accepted type is now `{ vault?: string }` - The `KeyringControllerOptions.keyringBuilders` type is now `{ (): Keyring<Json>; type: string }[]` - **BREAKING**: The `address` type accepted by the `removeAccount` method is now `Hex` ([#1441](MetaMask/core#1441)) - **BREAKING**: The `signTypedMessage` method now returns a `Promise<string>` ([#1441](MetaMask/core#1441)) - **BREAKING**: The `signTransaction` method now requires a `TypedTransaction` from `@ethereumjs/tx@^4` for the `transaction` argument, and returns a `Promise<TxData>` ([#1441](MetaMask/core#1441)) - **BREAKING:** Rename `Keyring` type to `KeyringObject` ([#1441](MetaMask/core#1441)) - **BREAKING:** `addNewAccount` now throws if address of new account is not a hex string ([#1441](MetaMask/core#1441)) - **BREAKING:** `exportSeedPhrase` now throws if first keyring does not have a mnemonic ([#1441](MetaMask/core#1441)) - **BREAKING:** `verifySeedPhrase` now throws if HD keyring does not have a mnemonic ([#1441](MetaMask/core#1441)) ## **Related issues** Fixes: #8180 ## **Manual testing steps** Use cases or flows to verify, 1. Onboarding 2. Import SRP 3. Import private key 4. Reveal SRP 5. Reveal private key 6. Add new account 7. Connect QR wallet 8. Signed type messages 9. Remove imported account 10. Lock and unlock wallet ## **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-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] 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. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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.
Explanation
This PR updates
@metamask/eth-keyring-controller
inKeyringController
to^13
.As after
v11.0.0
the library has been migrated to TS there is a number of changes needed to support it.Keyring
type used by@metamask/eth-keyring-controller
, which is still not supported by the latest released versions of the HD and simple keyrings.Keyring
type from@metamask/utils
has been added, superseding local type declarationsReferences
Changelog
@metamask/keyring-controller
keyringTypes
property from the KeyringController stateKeyringControllerOptions
type changedKeyringControllerOptions.state
accepted type is now{ vault?: string }
KeyringControllerOptions.keyringBuilders
type is now{ (): Keyring<Json>; type: string }[]
address
type accepted by theremoveAccount
method is nowHex
signTypedMessage
method now returns aPromise<string>
signTransaction
method now requires aTypedTransaction
from@ethereumjs/tx@^4
for thetransaction
argument, and returns aPromise<TxData>
Keyring
type toKeyringObject
addNewAccount
now throws if address of new account is not a hex stringexportSeedPhrase
now throws if first keyring does not have a mnemonicverifySeedPhrase
now throws if HD keyring does not have a mnemonicgetAccountKeyringType
toPromise<string>
addQRKeyring
has been renamed to#addQRKeyring
@metamask/eth-keyring-controller
to^13.0.0
Checklist