diff --git a/.circleci/config.yml b/.circleci/config.yml index f5d0aa3ea..b0aab4c7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,6 @@ -version: 2 +version: 2.1 workflows: - version: 2 test_and_release: jobs: - create_release_pull_request: diff --git a/.circleci/scripts/deps-install.sh b/.circleci/scripts/deps-install.sh index 20954ec0b..605eb8593 100755 --- a/.circleci/scripts/deps-install.sh +++ b/.circleci/scripts/deps-install.sh @@ -20,3 +20,6 @@ yarn --frozen-lockfile --ignore-scripts --har (cd node_modules/weak && yarn run install) (cd node_modules/chromedriver && yarn run install) (cd node_modules/geckodriver && yarn run postinstall) + +# for release +(cd node_modules/@sentry/cli && yarn run install) diff --git a/.eslintrc b/.eslintrc index 55fcb3c0c..c7c49a5be 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,7 +30,8 @@ "mocha", "chai", "react", - "json" + "json", + "import" ], "globals": { @@ -43,6 +44,7 @@ }, "rules": { + "import/no-unresolved": ["error", { "commonjs": true }], "no-restricted-globals": ["error", "event"], "accessor-pairs": 2, "arrow-spacing": [2, { "before": true, "after": true }], diff --git a/CHANGELOG.md b/CHANGELOG.md index 633374a91..22a22f75a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ ## Current Develop Branch +## 7.5.3 Fri Nov 15 2019 +- [#7412](https://github.com/MetaMask/metamask-extension/pull/7412): lock eth-contract-metadata (#7412) +- [#7416](https://github.com/MetaMask/metamask-extension/pull/7416): Add eslint import plugin to help detect unresolved paths +- [#7414](https://github.com/MetaMask/metamask-extension/pull/7414): Ensure SignatureRequestOriginal 'beforeunload' handler is bound (#7414) +- [#7430](https://github.com/MetaMask/metamask-extension/pull/7430): Update badge colour +- [#7408](https://github.com/MetaMask/metamask-extension/pull/7408): Utilize the full size of icon space (#7408) +- [#7431](https://github.com/MetaMask/metamask-extension/pull/7431): Add all icons to manifest (#7431) +- [#7426](https://github.com/MetaMask/metamask-extension/pull/7426): Ensure Etherscan result is valid before reading it (#7426) +- [#7434](https://github.com/MetaMask/metamask-extension/pull/7434): Update 512px icon (#7434) +- [#7410](https://github.com/MetaMask/metamask-extension/pull/7410): Fix sourcemaps for Sentry +- [#7420](https://github.com/MetaMask/metamask-extension/pull/7420): Adds and end to end test for typed signature requests +- [#7439](https://github.com/MetaMask/metamask-extension/pull/7439): Add metricsEvent to contextTypes (#7439) +- [#7419](https://github.com/MetaMask/metamask-extension/pull/7419): Added webRequest.RequestFilter to filter main_frame .eth requests (#7419) + ## 7.5.2 Thu Nov 14 2019 - [#7414](https://github.com/MetaMask/metamask-extension/pull/7414): Ensure SignatureRequestOriginal 'beforeunload' handler is bound diff --git a/app/images/icon-128.png b/app/images/icon-128.png index ffeb4563d..8d593bc0c 100644 Binary files a/app/images/icon-128.png and b/app/images/icon-128.png differ diff --git a/app/images/icon-16.png b/app/images/icon-16.png index c7b3248b3..3343f9774 100644 Binary files a/app/images/icon-16.png and b/app/images/icon-16.png differ diff --git a/app/images/icon-19.png b/app/images/icon-19.png index 6263cf3cf..5257d444a 100644 Binary files a/app/images/icon-19.png and b/app/images/icon-19.png differ diff --git a/app/images/icon-32.png b/app/images/icon-32.png index e21a43454..a7dfe7f6c 100644 Binary files a/app/images/icon-32.png and b/app/images/icon-32.png differ diff --git a/app/images/icon-38.png b/app/images/icon-38.png index cc2df8cdd..665468714 100644 Binary files a/app/images/icon-38.png and b/app/images/icon-38.png differ diff --git a/app/images/icon-512.png b/app/images/icon-512.png index c6781c5f9..a506fabe7 100644 Binary files a/app/images/icon-512.png and b/app/images/icon-512.png differ diff --git a/app/images/icon-64.png b/app/images/icon-64.png index 5f99e6a3f..643c02b31 100644 Binary files a/app/images/icon-64.png and b/app/images/icon-64.png differ diff --git a/app/manifest.json b/app/manifest.json index c863b973e..f3fc9ca36 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "7.5.2", + "version": "7.5.3", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", @@ -17,7 +17,12 @@ }, "icons": { "16": "images/icon-16.png", - "128": "images/icon-128.png" + "19": "images/icon-19.png", + "32": "images/icon-32.png", + "38": "images/icon-38.png", + "64": "images/icon-64.png", + "128": "images/icon-128.png", + "512": "images/icon-512.png" }, "applications": { "gecko": { @@ -36,8 +41,13 @@ }, "browser_action": { "default_icon": { + "16": "images/icon-16.png", "19": "images/icon-19.png", - "38": "images/icon-38.png" + "32": "images/icon-32.png", + "38": "images/icon-38.png", + "64": "images/icon-64.png", + "128": "images/icon-128.png", + "512": "images/icon-512.png" }, "default_title": "MetaMask", "default_popup": "popup.html" diff --git a/app/scripts/background.js b/app/scripts/background.js index 7c347d62e..2639d7703 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -426,7 +426,7 @@ function setupController (initState, initLangCode) { label = String(count) } extension.browserAction.setBadgeText({ text: label }) - extension.browserAction.setBadgeBackgroundColor({ color: '#506F8B' }) + extension.browserAction.setBadgeBackgroundColor({ color: '#037DD6' }) } return Promise.resolve() diff --git a/app/scripts/controllers/incoming-transactions.js b/app/scripts/controllers/incoming-transactions.js index 9ce6a4dd9..029bf47aa 100644 --- a/app/scripts/controllers/incoming-transactions.js +++ b/app/scripts/controllers/incoming-transactions.js @@ -208,7 +208,7 @@ class IncomingTransactionsController { } _processTxFetchResponse ({ status, result = [], address, currentNetworkID }) { - if (status !== '0' && result.length > 0) { + if (status === '1' && Array.isArray(result) && result.length > 0) { const remoteTxList = {} const remoteTxs = [] result.forEach((tx) => { diff --git a/app/scripts/lib/ens-ipfs/setup.js b/app/scripts/lib/ens-ipfs/setup.js index 6b75adfa4..a3711c5f9 100644 --- a/app/scripts/lib/ens-ipfs/setup.js +++ b/app/scripts/lib/ens-ipfs/setup.js @@ -10,7 +10,7 @@ function setupEnsIpfsResolver ({ provider }) { // install listener const urlPatterns = supportedTopLevelDomains.map(tld => `*://*.${tld}/*`) - extension.webRequest.onErrorOccurred.addListener(webRequestDidFail, { urls: urlPatterns }) + extension.webRequest.onErrorOccurred.addListener(webRequestDidFail, { urls: urlPatterns, types: ['main_frame']}) // return api object return { diff --git a/development/metamaskbot-build-announce.js b/development/metamaskbot-build-announce.js index 2198d7e36..d5b05e03c 100755 --- a/development/metamaskbot-build-announce.js +++ b/development/metamaskbot-build-announce.js @@ -1,6 +1,6 @@ #!/usr/bin/env node const request = require('request-promise') -const VERSION = require('../dist/chrome/manifest.json').version +const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved start().catch(console.error) diff --git a/development/mock-dev.js b/development/mock-dev.js index 188c04678..8da625149 100644 --- a/development/mock-dev.js +++ b/development/mock-dev.js @@ -15,7 +15,6 @@ const h = require('react-hyperscript') const Root = require('../ui/app/pages') const configureStore = require('../ui/app/store/store') const actions = require('../ui/app/store/actions') -const states = require('./states') const backGroundConnectionModifiers = require('./backGroundConnectionModifiers') const Selector = require('./selector') const MetamaskController = require('../app/scripts/metamask-controller') @@ -23,6 +22,9 @@ const firstTimeState = require('../app/scripts/first-time-state') const ExtensionPlatform = require('../app/scripts/platforms/extension') const noop = function () {} +// the states file is generated before this file is run, but after `lint` is run +const states = require('./states') /* eslint-disable-line import/no-unresolved */ + const log = require('loglevel') window.log = log log.setLevel('debug') diff --git a/development/sentry-publish.js b/development/sentry-publish.js index cab3d1ac8..8d9333a86 100644 --- a/development/sentry-publish.js +++ b/development/sentry-publish.js @@ -1,7 +1,7 @@ #!/usr/bin/env node const pify = require('pify') const exec = pify(require('child_process').exec, { multiArgs: true }) -const VERSION = require('../dist/chrome/manifest.json').version +const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved start().catch(console.error) diff --git a/package.json b/package.json index 7c8a1ad9f..fad7c4226 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "dnode": "^1.2.2", "end-of-stream": "^1.1.0", "eth-block-tracker": "^4.4.2", - "eth-contract-metadata": "^1.9.2", + "eth-contract-metadata": "1.9.3", "eth-ens-namehash": "^2.0.8", "eth-json-rpc-errors": "^1.1.0", "eth-json-rpc-filters": "^4.1.1", @@ -189,6 +189,7 @@ "@babel/preset-react": "^7.0.0", "@babel/register": "^7.5.5", "@sentry/cli": "^1.30.3", + "@storybook/addon-actions": "^5.2.6", "@storybook/addon-info": "^5.1.1", "@storybook/addon-knobs": "^3.4.2", "@storybook/react": "^5.1.1", @@ -211,6 +212,7 @@ "enzyme-adapter-react-15": "^1.0.6", "eslint": "^6.0.1", "eslint-plugin-chai": "0.0.1", + "eslint-plugin-import": "^2.18.2", "eslint-plugin-json": "^1.2.0", "eslint-plugin-mocha": "^5.0.0", "eslint-plugin-react": "^7.4.0", diff --git a/test/e2e/contract-test/contract.js b/test/e2e/contract-test/contract.js index 971523de2..ebfea34ec 100644 --- a/test/e2e/contract-test/contract.js +++ b/test/e2e/contract-test/contract.js @@ -41,6 +41,7 @@ web3.currentProvider.enable().then(() => { const approveTokens = document.getElementById('approveTokens') const transferTokensWithoutGas = document.getElementById('transferTokensWithoutGas') const approveTokensWithoutGas = document.getElementById('approveTokensWithoutGas') + const signTypedData = document.getElementById('signTypedData') deployButton.addEventListener('click', async function () { document.getElementById('contractStatus').innerHTML = 'Deploying' @@ -184,4 +185,57 @@ web3.currentProvider.enable().then(() => { ethereum.on('accountsChanged', (accounts) => { accountsDiv.innerHTML = accounts }) + + const signTypedDataResultsDiv = document.getElementById('signTypedDataResult') + signTypedData.addEventListener('click', function () { + + const typedData = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 3, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + sender: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + recipient: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + } + web3.currentProvider.sendAsync({ + method: 'eth_signTypedData_v3', + params: [ethereum.selectedAddress, JSON.stringify(typedData)], + from: ethereum.selectedAddress, + }, function (err, result) { + if (err) { + console.log(err) + } else { + signTypedDataResultsDiv.innerHTML = result + } + }) + }) }) diff --git a/test/e2e/contract-test/index.html b/test/e2e/contract-test/index.html index 03792de76..9689654ee 100644 --- a/test/e2e/contract-test/index.html +++ b/test/e2e/contract-test/index.html @@ -37,6 +37,13 @@