Skip to content

Conversation

@andrewpeters9
Copy link
Contributor

@andrewpeters9 andrewpeters9 commented Feb 5, 2023

❗️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

# 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
@andrewpeters9 andrewpeters9 requested a review from a team as a code owner February 5, 2023 18:24
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2023

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.

@andrewpeters9 andrewpeters9 marked this pull request as draft February 5, 2023 18:56
@andrewpeters9 andrewpeters9 added area-hardware MV3 MV3-non_perf MV3 issues not related to performance. labels Feb 6, 2023
@andrewpeters9 andrewpeters9 linked an issue Feb 6, 2023 that may be closed by this pull request
@@ -0,0 +1,169 @@
diff --git a/index.js b/index.js
Copy link
Contributor Author

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
Copy link
Contributor Author

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);
Copy link
Contributor Author

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 => {
Copy link
Contributor Author

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);
Copy link
Contributor Author

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);
Copy link
Contributor Author

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
Copy link

Socket Security Pull Request Report

Dependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again.

😵‍💫 Bin script confusion

This 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

Package Bin script Source
jest@29.4.2 (upgraded) jest package.json via @storybook/test-runner@0.9.4
jest-cli@28.1.3 (upgraded) jest package.json via @storybook/test-runner@0.9.4
jest-cli@29.4.2 (upgraded) jest package.json via @storybook/test-runner@0.9.4, jest@29.4.2
Pull request report summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script confusion ⚠️ 3 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@2.4.2

  • @SocketSecurity ignore jest@29.4.2
  • @SocketSecurity ignore jest-cli@28.1.3
  • @SocketSecurity ignore jest-cli@29.4.2

Powered by socket.dev

@brad-decker
Copy link
Contributor

@andrewpeters9 can this be updated to be considered for inclusion? Otherwise can we close?

@andrewpeters9
Copy link
Contributor Author

@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.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Jul 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

@github-actions github-actions bot closed this Aug 3, 2023
@HowardBraham HowardBraham deleted the hardware-wallet-fixes branch January 19, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-hardware MV3-non_perf MV3 issues not related to performance. MV3 stale issues and PRs marked as stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [MV3] Hardware Wallet Support

3 participants