-
Notifications
You must be signed in to change notification settings - Fork 5.5k
MV3 Hardware Wallet Changes #17608
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
MV3 Hardware Wallet Changes #17608
Conversation
# Conflicts: # app/scripts/metamask-controller.js
# Conflicts: # .yarn/patches/@MetaMask+eth-ledger-bridge-keyring+0.13.0.patch # .yarn/patches/eth-keyring-controller+8.1.0.patch # .yarn/patches/eth-trezor-keyring+0.10.0.patch # app/scripts/controllers/preferences.js
# Conflicts: # app/scripts/controllers/preferences.js # app/scripts/metamask-controller.js # app/scripts/migrations/066.js # package.json # shared/constants/hardware-wallets.js # yarn.lock
# Conflicts: # app/scripts/controllers/preferences.js
# Conflicts: # ui/store/action-queue/index.ts
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| @@ -0,0 +1,169 @@ | |||
| diff --git a/index.js b/index.js | |||
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.
Ignore these patches - will be replaced with package updates. Discussions on changes are happening in their respective repos
| @@ -0,0 +1,87 @@ | |||
| diff --git a/index.js b/index.js | |||
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.
Ignore this patch - a discussion regarding changes is occurring in the related repo.
| }, | ||
| backgroundSync: async (keyring, newState) => { | ||
| await keyring.deserialize(newState); | ||
| console.log('⬆️ State update for keyring', keyring.type, newState); |
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.
Ignore these console logs - they'll be removed post-draft.
| * | ||
| * @param error | ||
| */ | ||
| export const isServiceWorkerMv3Error = (error: any): boolean => { |
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.
I'm in two minds as to whether this should occur, and instead, we could just pass every error that occurs on the backend to the frontend.
| if (isUserSet) { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore | ||
| return isMv3ErrorMessage(error.cause.message); |
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.
Error.cause isn't implemented in the current TS version, and seems like lodash's type-narrowing doesn't help TS much here.
Might be worth creating a separate issue for a TS extension lib, such as https://github.com/andnp/SimplyTyped to aid with type-narrowing (as it has a helper isKeyOf that assists with these situations)
| } | ||
|
|
||
| // @TODO, handle responding to specific JSON-RPC messages | ||
| clientKeyringController.handleMethodCall(params); |
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.
@todo, pending resolution of an issue regarding transaction confirmation, this context of the function will only respond to specific JSON-RPC messages, so that multiple clients aren't being called simultaneously.
Socket Security Pull Request ReportDependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again. 😵💫 Bin script confusionThis package has multiple bin scripts with the same name. This can cause non-deterministic behavior when installing or could be a sign of a supply chain attack Consider removing one of the conflicting packages. Packages should only export bin scripts with their name
Pull request report summary
Bot CommandsTo ignore an alert, reply with a comment starting with
Powered by socket.dev |
|
@andrewpeters9 can this be updated to be considered for inclusion? Otherwise can we close? |
@brad-decker Could we leave this open until #17687 is no longer a draft or merged? As it's intended to be a backup for that MR in the case that MR's approach can't be implemented for whatever reason. |
|
This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions. |
|
This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions. |
❗️This MR currently serves as a backup to #17687 , don't spend time reviewing this unless you're wanting to look at the ideas that were previously proposed
Currently a draft. See the below GH Issue for an explanation/diagrams etc.
#16217