From 9cf7413e4bc2b301e8a23cab87e4eedb511b87b3 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 1 Sep 2021 13:55:06 -0230 Subject: [PATCH 1/7] 1559 ledger (#11951) * EIP-1559 - Provide support for Ledger * Update ui/selectors/selectors.js Co-authored-by: Mark Stacey * Add shared constants for hw types * bump eth-ledger-bridge-keyring to v0.7.0 Co-authored-by: David Walsh Co-authored-by: Mark Stacey Co-authored-by: Alex --- app/scripts/metamask-controller.js | 16 ++-------------- package.json | 2 +- shared/constants/hardware-wallets.js | 9 +++++++++ ui/selectors/selectors.js | 6 ++++-- yarn.lock | 22 ++++++---------------- 5 files changed, 22 insertions(+), 33 deletions(-) create mode 100644 shared/constants/hardware-wallets.js diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 05bfad876..115110620 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -29,6 +29,7 @@ import { } from '@metamask/controllers'; import { TRANSACTION_STATUSES } from '../../shared/constants/transaction'; import { MAINNET_CHAIN_ID } from '../../shared/constants/network'; +import { KEYRING_TYPES } from '../../shared/constants/hardware-wallets'; import { UI_NOTIFICATIONS } from '../../shared/notifications'; import { toChecksumHexAddress } from '../../shared/modules/hexstring-utils'; import { MILLISECOND } from '../../shared/constants/time'; @@ -77,16 +78,6 @@ export const METAMASK_CONTROLLER_EVENTS = { UPDATE_BADGE: 'updateBadge', }; -/** - * Accounts can be instantiated from simple, HD or the two hardware wallet - * keyring types. Both simple and HD are treated as default but we do special - * case accounts managed by a hardware wallet. - */ -const KEYRING_TYPES = { - LEDGER: 'Ledger Hardware', - TREZOR: 'Trezor Hardware', -}; - export default class MetamaskController extends EventEmitter { /** * @constructor @@ -2078,10 +2069,7 @@ export default class MetamaskController extends EventEmitter { const address = fromAddress || this.preferencesController.getSelectedAddress(); const keyring = await this.keyringController.getKeyringForAccount(address); - return ( - keyring.type !== KEYRING_TYPES.LEDGER && - keyring.type !== KEYRING_TYPES.TREZOR - ); + return keyring.type !== KEYRING_TYPES.TREZOR; } //============================================================================= diff --git a/package.json b/package.json index d0c4230d3..634277284 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "@material-ui/core": "^4.11.0", "@metamask/contract-metadata": "^1.28.0", "@metamask/controllers": "^14.0.2", - "@metamask/eth-ledger-bridge-keyring": "^0.6.0", + "@metamask/eth-ledger-bridge-keyring": "^0.7.0", "@metamask/eth-token-tracker": "^3.0.1", "@metamask/etherscan-link": "^2.1.0", "@metamask/jazzicon": "^2.0.0", diff --git a/shared/constants/hardware-wallets.js b/shared/constants/hardware-wallets.js new file mode 100644 index 000000000..880efb5b2 --- /dev/null +++ b/shared/constants/hardware-wallets.js @@ -0,0 +1,9 @@ +/** + * Accounts can be instantiated from simple, HD or the two hardware wallet + * keyring types. Both simple and HD are treated as default but we do special + * case accounts managed by a hardware wallet. + */ +export const KEYRING_TYPES = { + LEDGER: 'Ledger Hardware', + TREZOR: 'Trezor Hardware', +}; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index deed331b1..c0b6fb4e5 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -8,6 +8,7 @@ import { NETWORK_TYPE_RPC, NATIVE_CURRENCY_TOKEN_IMAGE_MAP, } from '../../shared/constants/network'; +import { KEYRING_TYPES } from '../../shared/constants/hardware-wallets'; import { SWAPS_CHAINID_DEFAULT_TOKEN_MAP, @@ -82,8 +83,9 @@ export function getCurrentKeyring(state) { } export function isEIP1559Account(state) { - // Neither hardware wallet supports 1559 at this time - return !isHardwareWallet(state); + // Trezor does not support 1559 at this time + const currentKeyring = getCurrentKeyring(state); + return currentKeyring && currentKeyring.type !== KEYRING_TYPES.TREZOR; } export function checkNetworkAndAccountSupports1559(state) { diff --git a/yarn.lock b/yarn.lock index 425241749..0f964c6f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1572,15 +1572,7 @@ crc-32 "^1.2.0" ethereumjs-util "^7.1.0" -"@ethereumjs/tx@^3.1.1", "@ethereumjs/tx@^3.1.4", "@ethereumjs/tx@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.2.1.tgz#65f5f1c11541764f08377a94ba4b0dcbbd67739e" - integrity sha512-i9V39OtKvwWos1uVNZxdVhd7zFOyzFLjgt69CoiOY0EmXugS0HjO3uxpLBSglDKFMRriuGqw6ddKEv+RP1UNEw== - dependencies: - "@ethereumjs/common" "^2.3.1" - ethereumjs-util "^7.0.10" - -"@ethereumjs/tx@^3.3.0": +"@ethereumjs/tx@^3.1.4", "@ethereumjs/tx@^3.2.0", "@ethereumjs/tx@^3.2.1", "@ethereumjs/tx@^3.3.0": version "3.3.0" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.3.0.tgz#14ed1b7fa0f28e1cd61e3ecbdab824205f6a4378" integrity sha512-yTwEj2lVzSMgE6Hjw9Oa1DZks/nKTWM8Wn4ykDNapBPua2f4nXO3qKnni86O6lgDj5fVNRqbDsD0yy7/XNGDEA== @@ -3142,16 +3134,14 @@ resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-6.0.0.tgz#ec53e8ab278073e882411ed89705bc7d06b78c81" integrity sha512-LyakGYGwM8UQOGhwWa+5erAI1hXuiTgf/y7USzOomX6H9KiuY09IAUYnPh7ToPG2sedD2F48UF1bUm8yvCoZOw== -"@metamask/eth-ledger-bridge-keyring@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.6.0.tgz#2f1344eb76bf880c8cfbb92b9b64510920c7e335" - integrity sha512-eP0f8Q7o5K35wVinK2EjEw/gVY/pvzkAcbk49CwQEzGPKm6d+AAURJZ0o33/8gYGIrpq4bmWZhZzgyAbphgVLw== +"@metamask/eth-ledger-bridge-keyring@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.7.0.tgz#7d80e1e3dfab91ba2b6a1a2a5e352320e948b568" + integrity sha512-0UOEb/c3/fkatDK+se3gOHaGQ0RTRLbG5DqsoeowZ/JcO4wcMxBhOiIgOY4domOqUTekKKVPNC7Pc0mHpM9sAQ== dependencies: - "@ethereumjs/tx" "^3.1.1" + "@ethereumjs/tx" "^3.2.0" eth-sig-util "^2.0.0" - ethereumjs-tx "^1.3.4" ethereumjs-util "^7.0.9" - events "^2.0.0" hdkey "0.8.0" "@metamask/eth-token-tracker@^3.0.1": From c3ca4916aadd0dbe5fe7227494d41b3a98200c80 Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 30 Aug 2021 20:58:50 -0700 Subject: [PATCH 2/7] Using a normal bundle instead of a factored bundle for phishing-detect (build sys) (#11972) --- development/build/scripts.js | 28 ++++++++++++++++++---------- development/build/static.js | 4 ++++ development/sourcemap-validator.js | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index f953b72eb..130e1f0f1 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -74,12 +74,7 @@ function createScriptTasks({ browserPlatforms, livereload }) { return { dev, test, testDev, prod }; function createTasksForBuildJsExtension({ taskPrefix, devMode, testing }) { - const standardEntryPoints = [ - 'background', - 'ui', - 'phishing-detect', - 'content-script', - ]; + const standardEntryPoints = ['background', 'ui', 'content-script']; const standardSubtask = createTask( `${taskPrefix}:standardEntryPoints`, createFactoredBuild({ @@ -114,6 +109,11 @@ function createScriptTasks({ browserPlatforms, livereload }) { createTaskForBundleSentry({ devMode }), ); + const phishingDetectSubtask = createTask( + `${taskPrefix}:phishing-detect`, + createTaskForBundlePhishingDetect({ devMode }), + ); + // task for initiating browser livereload const initiateLiveReload = async () => { if (devMode) { @@ -136,6 +136,7 @@ function createScriptTasks({ browserPlatforms, livereload }) { contentscriptSubtask, disableConsoleSubtask, installSentrySubtask, + phishingDetectSubtask, ].map((subtask) => runInChildProcess(subtask)); // make a parent task that runs each task in a child thread return composeParallel(initiateLiveReload, ...allSubtasks); @@ -163,6 +164,17 @@ function createScriptTasks({ browserPlatforms, livereload }) { }); } + function createTaskForBundlePhishingDetect({ devMode }) { + const label = 'phishing-detect'; + return createNormalBundle({ + label, + entryFilepath: `./app/scripts/${label}.js`, + destFilepath: `${label}.js`, + devMode, + browserPlatforms, + }); + } + // the "contentscript" bundle contains the "inpage" bundle function createTaskForBundleContentscript({ devMode, testing }) { const inpage = 'inpage'; @@ -277,10 +289,6 @@ function createFactoredBuild({ renderHtmlFile('home', groupSet, commonSet, browserPlatforms); break; } - case 'phishing-detect': { - renderHtmlFile('phishing', groupSet, commonSet, browserPlatforms); - break; - } case 'background': { renderHtmlFile('background', groupSet, commonSet, browserPlatforms); break; diff --git a/development/build/static.js b/development/build/static.js index 300134806..9d6ba3060 100644 --- a/development/build/static.js +++ b/development/build/static.js @@ -60,6 +60,10 @@ const copyTargets = [ src: require.resolve('@lavamoat/lavapack/src/runtime-cjs.js'), dest: `runtime-cjs.js`, }, + { + src: `./app/phishing.html`, + dest: `phishing.html`, + }, ]; const languageTags = new Set(); diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index 504e87e80..01861e229 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -24,7 +24,7 @@ async function start() { `common-0.js`, `background-0.js`, `ui-0.js`, - 'phishing-detect-0.js', + 'phishing-detect.js', // `contentscript.js`, skipped because the validator is erroneously sampling the inlined `inpage.js` script `inpage.js`, ]; From a70b9c346b0e5901f64afc6b8f66e90e14f06dc1 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Wed, 1 Sep 2021 17:50:44 +0000 Subject: [PATCH 3/7] Version v10.1.0 --- CHANGELOG.md | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de967d882..0407408be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.1.0] +### Uncategorized +- Using a normal bundle instead of a factored bundle for phishing-detect (build sys) ([#11972](https://github.com/MetaMask/metamask-extension/pull/11972)) +- 1559 ledger ([#11951](https://github.com/MetaMask/metamask-extension/pull/11951)) + ## [10.0.3] ### Changed - [#11931](https://github.com/MetaMask/metamask-extension/pull/11931): Temporarily Disabling Mobile Sync @@ -2422,7 +2427,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.0.3...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.1.0...HEAD +[10.1.0]: https://github.com/MetaMask/metamask-extension/compare/v10.0.3...v10.1.0 [10.0.3]: https://github.com/MetaMask/metamask-extension/compare/v10.0.2...v10.0.3 [10.0.2]: https://github.com/MetaMask/metamask-extension/compare/v10.0.1...v10.0.2 [10.0.1]: https://github.com/MetaMask/metamask-extension/compare/v10.0.0...v10.0.1 diff --git a/package.json b/package.json index 634277284..3cf0a34ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.0.3", + "version": "10.1.0", "private": true, "repository": { "type": "git", From fdcb880b808355d9d91417262fecb938cf08d4a0 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 1 Sep 2021 12:29:02 -0700 Subject: [PATCH 4/7] [skip e2e] Update changelog for v10.1.0 (#11993) --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0407408be..3ddcc00b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [10.1.0] -### Uncategorized -- Using a normal bundle instead of a factored bundle for phishing-detect (build sys) ([#11972](https://github.com/MetaMask/metamask-extension/pull/11972)) -- 1559 ledger ([#11951](https://github.com/MetaMask/metamask-extension/pull/11951)) +### Added +- [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Adding EIP-1559 support for Ledger hardware + +### Fixed +- [#11972](https://github.com/MetaMask/metamask-extension/pull/11972): Fixing "continue at your own risk" button (Phishing alert page) ## [10.0.3] ### Changed From 7daa55a52c61627d85c7fcec35ababc7e7aea427 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Wed, 1 Sep 2021 10:40:40 -0600 Subject: [PATCH 5/7] Fix 'yarn setup' on M1 Macs (#11887) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are a few issues encountered when running `yarn setup` on new Apple Silicon (aka M1, aka arm64) Macs: * The script halts when attempting to run the install step for the `chromedriver` package with the message "Only Mac 64 bits supported". This is somewhat misleading as it seems to indicate that chromedriver can only be installed on a 64-bit Mac. However, what I think is happening is that the installation script for `chromedriver` is not able to detect that an arm64 CPU *is* a 64-bit CPU. After looking through the `chromedriver` repo, it appears that 87.0.1 is the first version that adds a proper check ([1]). Note that upgrading chromedriver caused the Chrome-specific tests to fail intermittently on CI. I was not able to 100% work out the reason for this, but ensuring that X (which provides a way for Chrome to run in a GUI setting from the command line) is available seems to fix these issues. * The script also halts when attempting to run the install step for the `electron` package. This happens because for the version of `electron` we are using (9.4.2), there is no available binary for arm64. It appears that Electron 11.x was the first version to support arm64 Macs ([2]). This is a bit trickier to resolve because we don't explicitly rely on `electron` — that's brought in by `react-devtools`. The first version of `react-devtools` that relies on `electron` 11.x is 4.11.0 ([3]). [1]: https://github.com/giggio/node-chromedriver/commit/469dd0a6ee23540bfa832b5f09b4cbde3e152010 [2]: https://www.electronjs.org/blog/apple-silicon [3]: https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md#4110-april-9-2021 --- .circleci/scripts/chrome-install.sh | 8 +- development/lib/retry.js | 31 ++++++-- package.json | 4 +- test/e2e/benchmark.js | 2 +- test/e2e/helpers.js | 4 + test/e2e/metamask-ui.spec.js | 4 + test/e2e/run-e2e-test.js | 2 +- test/e2e/x-server.js | 17 ++++ yarn.lock | 116 ++++++++++++++++------------ 9 files changed, 124 insertions(+), 64 deletions(-) create mode 100644 test/e2e/x-server.js diff --git a/.circleci/scripts/chrome-install.sh b/.circleci/scripts/chrome-install.sh index 37272e1a5..2691ebf72 100755 --- a/.circleci/scripts/chrome-install.sh +++ b/.circleci/scripts/chrome-install.sh @@ -4,11 +4,11 @@ set -e set -u set -o pipefail -CHROME_VERSION='79.0.3945.117-1' +CHROME_VERSION='87.0.4280.88-1' CHROME_BINARY="google-chrome-stable_${CHROME_VERSION}_amd64.deb" -CHROME_BINARY_URL="http://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/${CHROME_BINARY}" +CHROME_BINARY_URL="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${CHROME_BINARY}" -CHROME_BINARY_SHA512SUM='2d4f76202219a40e560477d79023fa4a847187a086278924a9d916dcd5fbefafdcf7dfd8879fae907b8276b244e71a3b8a1b00a88dee87b18738ce31134a6713' +CHROME_BINARY_SHA512SUM='19eea1d1be171cab60ce5135572da9388b4b72e313118478b53f65c0bf2293733809282736b98ef828a208b7426e5191258f8c666cba7510b8bf5c92d0010a47' wget -O "${CHROME_BINARY}" -t 5 "${CHROME_BINARY_URL}" @@ -24,6 +24,4 @@ fi rm -rf "${CHROME_BINARY}" -sudo sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' "/opt/google/chrome/google-chrome" - printf '%s\n' "CHROME ${CHROME_VERSION} configured" diff --git a/development/lib/retry.js b/development/lib/retry.js index 356f1a08f..f4a2307ab 100644 --- a/development/lib/retry.js +++ b/development/lib/retry.js @@ -1,13 +1,31 @@ /** - * Run the given function, retrying it upon failure until reaching the - * specified number of retries. + * Re-runs the given function until it returns a resolved promise or the number + * of retries is exceeded, whichever comes first (with an optional delay in + * between retries). * - * @param {number} retries - The number of retries upon failure to attempt. - * @param {function} functionToRetry - The function that will be retried upon failure. + * @param {Object} args - A set of arguments and options. + * @param {number} args.retries - The maximum number of times to re-run the + * function on failure. + * @param {number} args.delay - The amount of time (in milliseconds) to wait in + * between retries. (Default: 0) + * @param {string} args.rejectionMessage - The message for the rejected promise + * this function will return in the event of failure. (Default: "Retry limit + * reached") + * @param {function} functionToRetry - The function that is run and tested for + * failure. + * @returns {Promise} a promise that either resolves to null if + * the function is successful or is rejected with rejectionMessage otherwise. */ -async function retry(retries, functionToRetry) { +async function retry( + { retries, delay = 0, rejectionMessage = 'Retry limit reached' }, + functionToRetry, +) { let attempts = 0; while (attempts <= retries) { + if (attempts > 0 && delay > 0) { + await new Promise((resolve) => setTimeout(resolve, delay)); + } + try { await functionToRetry(); return; @@ -17,7 +35,8 @@ async function retry(retries, functionToRetry) { attempts += 1; } } - throw new Error('Retry limit reached'); + + throw new Error(rejectionMessage); } module.exports = { retry }; diff --git a/package.json b/package.json index 3cf0a34ce..71d4aa3f1 100644 --- a/package.json +++ b/package.json @@ -247,7 +247,7 @@ "brfs": "^2.0.2", "browserify": "^16.5.1", "chalk": "^3.0.0", - "chromedriver": "^79.0.0", + "chromedriver": "^87.0.1", "concurrently": "^5.2.0", "copy-webpack-plugin": "^6.0.3", "cross-spawn": "^7.0.3", @@ -303,7 +303,7 @@ "pumpify": "^2.0.1", "randomcolor": "^0.5.4", "rc": "^1.2.8", - "react-devtools": "^4.10.1", + "react-devtools": "^4.11.0", "read-installed": "^4.0.3", "redux-mock-store": "^1.5.4", "remote-redux-devtools": "^0.5.16", diff --git a/test/e2e/benchmark.js b/test/e2e/benchmark.js index fc8843c58..c5ad8ebb7 100644 --- a/test/e2e/benchmark.js +++ b/test/e2e/benchmark.js @@ -62,7 +62,7 @@ async function profilePageLoad(pages, numSamples, retries) { const runResults = []; for (let i = 0; i < numSamples; i += 1) { let result; - await retry(retries, async () => { + await retry({ retries }, async () => { result = await measurePage(pageName); }); runResults.push(result); diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index cde3b0243..b799f1d53 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -7,6 +7,7 @@ const { const Ganache = require('./ganache'); const FixtureServer = require('./fixture-server'); const { buildWebDriver } = require('./webdriver'); +const { ensureXServerIsRunning } = require('./x-server'); const tinyDelayMs = 200; const regularDelayMs = tinyDelayMs * 2; @@ -81,6 +82,9 @@ async function withFixtures(options, testSuite) { }); await segmentServer.start(9090); } + if (process.env.SELENIUM_BROWSER === 'chrome') { + await ensureXServerIsRunning(); + } const { driver } = await buildWebDriver(driverOptions); webDriver = driver; diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 1b19b45ec..73af211d0 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -6,6 +6,7 @@ const createStaticServer = require('../../development/create-static-server'); const { tinyDelayMs, regularDelayMs, largeDelayMs } = require('./helpers'); const { buildWebDriver } = require('./webdriver'); const Ganache = require('./ganache'); +const { ensureXServerIsRunning } = require('./x-server'); const ganacheServer = new Ganache(); const dappPort = 8080; @@ -39,6 +40,9 @@ describe('MetaMask', function () { dappServer.on('listening', resolve); dappServer.on('error', reject); }); + if (process.env.SELENIUM_BROWSER === 'chrome') { + await ensureXServerIsRunning(); + } const result = await buildWebDriver(); driver = result.driver; await driver.navigate(); diff --git a/test/e2e/run-e2e-test.js b/test/e2e/run-e2e-test.js index ce349ad02..c732de709 100644 --- a/test/e2e/run-e2e-test.js +++ b/test/e2e/run-e2e-test.js @@ -73,7 +73,7 @@ async function main() { process.env.E2E_LEAVE_RUNNING = 'true'; } - await retry(retries, async () => { + await retry({ retries }, async () => { await runInShell('yarn', ['mocha', '--no-timeouts', e2eTestPath]); }); } diff --git a/test/e2e/x-server.js b/test/e2e/x-server.js new file mode 100644 index 000000000..9be32b099 --- /dev/null +++ b/test/e2e/x-server.js @@ -0,0 +1,17 @@ +const { runCommand } = require('../../development/lib/run-command'); +const { retry } = require('../../development/lib/retry'); + +function ensureXServerIsRunning() { + return retry( + { + retries: 3, + delay: 2000, + rejectionMessage: 'X server does not seem to be running?!', + }, + () => { + return runCommand('xset', ['q']); + }, + ); +} + +module.exports = { ensureXServerIsRunning }; diff --git a/yarn.lock b/yarn.lock index 0f964c6f4..80cf68a8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4085,6 +4085,11 @@ dependencies: defer-to-connect "^1.0.1" +"@testim/chrome-version@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.0.7.tgz#0cd915785ec4190f08a3a6acc9b61fc38fb5f1a9" + integrity sha512-8UT/J+xqCYfn3fKtOznAibsHpiuDshCb0fwgWxRazTT19Igp9ovoXMPhXyLD6m3CKQGTMHgqoxaFfMWaL40Rnw== + "@testing-library/dom@^7.17.1": version "7.22.2" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.22.2.tgz#6deaa828500993cc94bdd62875c251b5b5b70d69" @@ -4633,6 +4638,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yauzl@^2.9.1": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.2.tgz#c48e5d56aff1444409e39fa164b0b4d4552a7b7a" + integrity sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA== + dependencies: + "@types/node" "*" + "@typescript-eslint/experimental-utils@^4.0.1": version "4.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.21.0.tgz#0b0bb7c15d379140a660c003bdbafa71ae9134b6" @@ -8276,15 +8288,18 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^79.0.0: - version "79.0.0" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-79.0.0.tgz#1660ac29924dfcd847911025593d6b6746aeea35" - integrity sha512-DO29C7ntJfzu6q1vuoWwCON8E9x5xzopt7Q41A7Dr7hBKcdNpGw1l9DTt9b+l1qviOWiJLGsD+jHw21ptEHubA== +chromedriver@^87.0.1: + version "87.0.7" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-87.0.7.tgz#74041e02ff7f633e91b98eb707e2476f713dc4ca" + integrity sha512-7J7iN2rJuSDsKb9BUUMewJt07PuTlZYd809D10dUCT1rjMD3i2jUw7dum9RxdC1xO3aFwMd8TwZ5NR82T+S+Dg== dependencies: - del "^4.1.1" - extract-zip "^1.6.7" - mkdirp "^0.5.1" - request "^2.88.0" + "@testim/chrome-version" "^1.0.7" + axios "^0.21.1" + del "^6.0.0" + extract-zip "^2.0.1" + https-proxy-agent "^5.0.0" + mkdirp "^1.0.4" + proxy-from-env "^1.1.0" tcp-port-used "^1.0.1" ci-info@^1.5.0: @@ -9791,18 +9806,19 @@ del@^3.0.0: pify "^3.0.0" rimraf "^2.2.8" -del@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" - integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ== +del@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-6.0.0.tgz#0b40d0332cea743f1614f818be4feb717714c952" + integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ== dependencies: - "@types/glob" "^7.1.1" - globby "^6.1.0" - is-path-cwd "^2.0.0" - is-path-in-cwd "^2.0.0" - p-map "^2.0.0" - pify "^4.0.1" - rimraf "^2.6.3" + globby "^11.0.1" + graceful-fs "^4.2.4" + is-glob "^4.0.1" + is-path-cwd "^2.2.0" + is-path-inside "^3.0.2" + p-map "^4.0.0" + rimraf "^3.0.2" + slash "^3.0.0" delayed-stream@~1.0.0: version "1.0.0" @@ -10367,10 +10383,10 @@ electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.47, electron-to-chromiu resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.610.tgz#1254eb394acd220a836ea1f203f8cded4e487052" integrity sha512-eFDC+yVQpEhtlapk4CYDPfV9ajF9cEof5TBcO49L1ETO+aYogrKWDmYpZyxBScMNe8Bo/gJamH4amQ4yyvXg4g== -electron@^9.1.0: - version "9.4.2" - resolved "https://registry.yarnpkg.com/electron/-/electron-9.4.2.tgz#0c76dfc3d317108adac66844b868a9e2e57d48f5" - integrity sha512-WpnJLDFHtj5eIewAi4hMHxGdbwkzjzmxsMu/BtDFCic3wpruchkskL7EV28Sg/IYTAqo6yN5ISfnFaQcLsIdng== +electron@^11.1.0: + version "11.4.12" + resolved "https://registry.yarnpkg.com/electron/-/electron-11.4.12.tgz#3315ce63a37cea5033125f7abcfdcc2f76864a57" + integrity sha512-Kaf4uNaKcGWlBuZwFJ4OZcIN1cfVe9jlGgjm6pUIAJucUsUU7hCFOtaVdZ1sMJR2zbshIbwbiczq8+S61jLfUA== dependencies: "@electron/get" "^1.0.1" "@types/node" "^12.0.12" @@ -12430,7 +12446,7 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@^1.0.3, extract-zip@^1.6.7: +extract-zip@^1.0.3: version "1.7.0" resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927" integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA== @@ -12440,6 +12456,17 @@ extract-zip@^1.0.3, extract-zip@^1.6.7: mkdirp "^0.5.4" yauzl "^2.10.0" +extract-zip@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" + integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== + dependencies: + debug "^4.1.1" + get-stream "^5.1.0" + yauzl "^2.10.0" + optionalDependencies: + "@types/yauzl" "^2.9.1" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -16030,7 +16057,7 @@ is-path-cwd@^1.0.0: resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= -is-path-cwd@^2.0.0: +is-path-cwd@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== @@ -16042,13 +16069,6 @@ is-path-in-cwd@^1.0.0: dependencies: is-path-inside "^1.0.0" -is-path-in-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" - integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ== - dependencies: - is-path-inside "^2.1.0" - is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" @@ -16056,12 +16076,10 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-path-inside@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" - integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg== - dependencies: - path-is-inside "^1.0.2" +is-path-inside@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== is-plain-obj@^1.0.0, is-plain-obj@^1.1, is-plain-obj@^1.1.0: version "1.1.0" @@ -22934,24 +22952,24 @@ react-dev-utils@^10.0.0: strip-ansi "6.0.0" text-table "0.2.0" -react-devtools-core@4.10.1: - version "4.10.1" - resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.10.1.tgz#6d57db291aeac9cc45ef9fb4636dd2ab97490daf" - integrity sha512-sXbBjGAWcf9HAblTP/zMtFhGHqxAfIR+GPxONZsSGN9FHnF4635dx1s2LdQWG9rJ+Ehr3nWg+BUAB6P78my5PA== +react-devtools-core@4.16.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.16.0.tgz#c640ab15b98d077bc47f10f84fc8ed3633f537bd" + integrity sha512-fqyVbp+wVVey6O4uVBk5s3J/vTiPludp7lulr6a8asTBm7DIA0vLBbjmAOLCnOlkWcgdy4mjsqOgNCbu8uICWw== dependencies: shell-quote "^1.6.1" ws "^7" -react-devtools@^4.10.1: - version "4.10.1" - resolved "https://registry.yarnpkg.com/react-devtools/-/react-devtools-4.10.1.tgz#579c14fe0b181e222e262a75fc55c2e2e17abc7a" - integrity sha512-gGOu0tcpCdm2+LZNrFgyimImtkYDoi6z5aKMRxxfuRM0VrJpmZakxAwaLs0BMRA9+UUF22Emzku366+m5eBtIQ== +react-devtools@^4.11.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/react-devtools/-/react-devtools-4.16.0.tgz#89440dfb27b5f57ca8c098e91c9039308ace6395" + integrity sha512-K+EUWY0kWIwhBJSQotn9BnbXsGXM6S55bhZV7MMWQBop8dc/jVBWKklr6vM4jOTg3kxpXiVj7KJDv45hceiSZw== dependencies: cross-spawn "^5.0.1" - electron "^9.1.0" + electron "^11.1.0" ip "^1.1.4" minimist "^1.2.3" - react-devtools-core "4.10.1" + react-devtools-core "4.16.0" update-notifier "^2.1.0" react-dnd-html5-backend@^7.4.4: @@ -23964,7 +23982,7 @@ request-promise-native@^1.0.9: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.79.0, request@^2.83.0, request@^2.85.0, request@^2.88.0, request@^2.88.2, request@~2.88.0: +request@^2.79.0, request@^2.83.0, request@^2.85.0, request@^2.88.2, request@~2.88.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== From 0a361edc86cfd0b4be1e12e81b3b3deb71ddc214 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 1 Sep 2021 17:15:39 -0700 Subject: [PATCH 6/7] Updating changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ddcc00b2..ad78bb7c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Adding EIP-1559 support for Ledger hardware ### Fixed +- [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Fixing contract deployments using Ledger hardware - [#11972](https://github.com/MetaMask/metamask-extension/pull/11972): Fixing "continue at your own risk" button (Phishing alert page) ## [10.0.3] From a4ab20d8fc3d126f60362adb923607f58a946093 Mon Sep 17 00:00:00 2001 From: ryanml Date: Thu, 2 Sep 2021 10:17:31 -0700 Subject: [PATCH 7/7] Updating changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad78bb7c9..165e7c8b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Adding EIP-1559 support for Ledger hardware ### Fixed -- [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Fixing contract deployments using Ledger hardware -- [#11972](https://github.com/MetaMask/metamask-extension/pull/11972): Fixing "continue at your own risk" button (Phishing alert page) +- [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Fixed contract deployments using Ledger hardware +- [#11972](https://github.com/MetaMask/metamask-extension/pull/11972): Fixed "continue at your own risk" button (Phishing alert page) +- [#11951](https://github.com/MetaMask/metamask-extension/pull/11951): Fixed ledger transactions on networks with large chainIds ## [10.0.3] ### Changed