Skip to content

Commit

Permalink
Enable legacy HD paths for trezor users (#19552)
Browse files Browse the repository at this point in the history
* Update eth-trezor-keyring to v1.1.0

* Revert "Revert "feature: Add legacy derivation path to Trezor (#19443)" (#19451)"

This reverts commit b5ef94b.

* Fix trezor import

* Update lavamoat policies

* Remove accidentally committed code

* Fix type in previous commit
  • Loading branch information
danjm authored Aug 22, 2023
1 parent 787fc13 commit b852556
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager'
import { errorCodes as rpcErrorCodes, EthereumRpcError } from 'eth-rpc-errors';
import { Mutex } from 'await-semaphore';
import log from 'loglevel';
import TrezorKeyring from '@metamask/eth-trezor-keyring';
import { TrezorKeyring } from '@metamask/eth-trezor-keyring';
import LedgerBridgeKeyring from '@metamask/eth-ledger-bridge-keyring';
import LatticeKeyring from 'eth-lattice-keyring';
import { MetaMaskKeyring as QRHardwareKeyring } from '@keystonehq/metamask-airgapped-keyring';
Expand Down
2 changes: 1 addition & 1 deletion development/sentry-upload-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function upload_sourcemaps {
local release="${1}"; shift
local dist_directory="${1}"; shift

sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/*.js "${dist_directory}"/sourcemaps/ --rewrite --url-prefix '/metamask'
sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/*.js "${dist_directory}"/sourcemaps/ --rewrite --url-prefix 'metamask'
}

function main {
Expand Down
13 changes: 13 additions & 0 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1276,13 +1276,26 @@
"packages": {
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-trezor-keyring>@metamask/utils": true,
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": true,
"@metamask/eth-trezor-keyring>@trezor/connect-web": true,
"@metamask/eth-trezor-keyring>hdkey": true,
"browserify>buffer": true,
"browserify>events": true
}
},
"@metamask/eth-trezor-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": {
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true
Expand Down
13 changes: 13 additions & 0 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1404,13 +1404,26 @@
"packages": {
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-trezor-keyring>@metamask/utils": true,
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": true,
"@metamask/eth-trezor-keyring>@trezor/connect-web": true,
"@metamask/eth-trezor-keyring>hdkey": true,
"browserify>buffer": true,
"browserify>events": true
}
},
"@metamask/eth-trezor-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": {
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true
Expand Down
13 changes: 13 additions & 0 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1404,13 +1404,26 @@
"packages": {
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-trezor-keyring>@metamask/utils": true,
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": true,
"@metamask/eth-trezor-keyring>@trezor/connect-web": true,
"@metamask/eth-trezor-keyring>hdkey": true,
"browserify>buffer": true,
"browserify>events": true
}
},
"@metamask/eth-trezor-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": {
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true
Expand Down
13 changes: 13 additions & 0 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1276,13 +1276,26 @@
"packages": {
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-trezor-keyring>@metamask/utils": true,
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": true,
"@metamask/eth-trezor-keyring>@trezor/connect-web": true,
"@metamask/eth-trezor-keyring>hdkey": true,
"browserify>buffer": true,
"browserify>events": true
}
},
"@metamask/eth-trezor-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": {
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true
Expand Down
13 changes: 13 additions & 0 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1417,13 +1417,26 @@
"packages": {
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-trezor-keyring>@metamask/utils": true,
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": true,
"@metamask/eth-trezor-keyring>@trezor/connect-web": true,
"@metamask/eth-trezor-keyring>hdkey": true,
"browserify>buffer": true,
"browserify>events": true
}
},
"@metamask/eth-trezor-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
"superstruct": true
}
},
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": {
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"@metamask/eth-ledger-bridge-keyring": "^0.15.0",
"@metamask/eth-snap-keyring": "^0.1.3",
"@metamask/eth-token-tracker": "^4.0.0",
"@metamask/eth-trezor-keyring": "^1.0.0",
"@metamask/eth-trezor-keyring": "^1.1.0",
"@metamask/etherscan-link": "^2.2.0",
"@metamask/gas-fee-controller": "^6.0.1",
"@metamask/jazzicon": "^2.0.0",
Expand Down
1 change: 1 addition & 0 deletions ui/pages/create-account/connect-hardware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const LATTICE_HD_PATHS = [
const TREZOR_TESTNET_PATH = `m/44'/1'/0'/0`;
export const TREZOR_HD_PATHS = [
{ name: `BIP44 Standard (e.g. MetaMask, Trezor)`, value: BIP44_PATH },
{ name: `Legacy (Ledger / MEW / MyCrypto)`, value: MEW_PATH },
{ name: `Trezor Testnets`, value: TREZOR_TESTNET_PATH },
];

Expand Down
11 changes: 6 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4182,17 +4182,18 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-trezor-keyring@npm:^1.0.0":
version: 1.0.0
resolution: "@metamask/eth-trezor-keyring@npm:1.0.0"
"@metamask/eth-trezor-keyring@npm:^1.1.0":
version: 1.1.0
resolution: "@metamask/eth-trezor-keyring@npm:1.1.0"
dependencies:
"@ethereumjs/tx": "npm:^4.0.0"
"@ethereumjs/util": "npm:^8.0.0"
"@metamask/eth-sig-util": "npm:^5.0.2"
"@metamask/utils": "npm:^4.0.0"
"@trezor/connect-plugin-ethereum": "npm:^9.0.1"
"@trezor/connect-web": "npm:^9.0.6"
hdkey: "npm:0.8.0"
checksum: 421da0ffef37f92d0b16d360acf00317bce32bf1a5471d98cf30b7536df38f111cb894006210997c8c1aa6da2e1b291e22571451cd771a8d2f084da111a2d038
checksum: eb1ac827d07a6c2d7b0f1f291691b13b1b65db85f4bced5e2af9f5bdf9117a9b725673b069ad67fd57b7c525cbb53755f8b3877a1f2c72e7812b2d8e127a52a9
languageName: node
linkType: hard

Expand Down Expand Up @@ -24214,7 +24215,7 @@ __metadata:
"@metamask/eth-ledger-bridge-keyring": "npm:^0.15.0"
"@metamask/eth-snap-keyring": "npm:^0.1.3"
"@metamask/eth-token-tracker": "npm:^4.0.0"
"@metamask/eth-trezor-keyring": "npm:^1.0.0"
"@metamask/eth-trezor-keyring": "npm:^1.1.0"
"@metamask/etherscan-link": "npm:^2.2.0"
"@metamask/forwarder": "npm:^1.1.0"
"@metamask/gas-fee-controller": "npm:^6.0.1"
Expand Down

0 comments on commit b852556

Please sign in to comment.