From 6d9ea863bd956399a23c13f6ed97ba130336aa04 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 1 Feb 2018 16:14:28 -0800 Subject: [PATCH 01/10] Make announcement more general --- development/announcer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/announcer.js b/development/announcer.js index 43ae60acb..e97ea65b6 100644 --- a/development/announcer.js +++ b/development/announcer.js @@ -7,6 +7,6 @@ var changelog = fs.readFileSync(path.join(__dirname, '..', 'CHANGELOG.md')).toSt var log = changelog.split(version)[1].split('##')[0].trim() -let msg = `*MetaMask ${version}* now published to the Chrome Store! It should auto-update soon!\n${log}` +let msg = `*MetaMask ${version}* now published! It should auto-update soon!\n${log}` console.log(msg) From 94cd5b9df480a0c2e2897495c9edddd13461f23a Mon Sep 17 00:00:00 2001 From: kumavis Date: Sat, 10 Feb 2018 19:33:33 +0000 Subject: [PATCH 02/10] metamask mesh - inject mesh testing container --- app/scripts/background.js | 4 ++++ app/scripts/lib/setupMetamaskMeshMetrics.js | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 app/scripts/lib/setupMetamaskMeshMetrics.js diff --git a/app/scripts/background.js b/app/scripts/background.js index 0471cee3b..6bf7707e8 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -14,6 +14,7 @@ const NotificationManager = require('./lib/notification-manager.js') const MetamaskController = require('./metamask-controller') const firstTimeState = require('./first-time-state') const setupRaven = require('./setupRaven') +const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') const STORAGE_KEY = 'metamask-config' const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG' @@ -37,6 +38,9 @@ const diskStore = new LocalStorageStore({ storageKey: STORAGE_KEY }) // initialization flow initialize().catch(log.error) +// setup metamask mesh testing container +setupMetamaskMeshMetrics() + async function initialize () { const initState = await loadStateFromPersistence() await setupController(initState) diff --git a/app/scripts/lib/setupMetamaskMeshMetrics.js b/app/scripts/lib/setupMetamaskMeshMetrics.js new file mode 100644 index 000000000..40343f017 --- /dev/null +++ b/app/scripts/lib/setupMetamaskMeshMetrics.js @@ -0,0 +1,9 @@ + +module.exports = setupMetamaskMeshMetrics + +function setupMetamaskMeshMetrics() { + const testingContainer = document.createElement('iframe') + testingContainer.src = 'https://metamask.github.io/mesh-testing/' + console.log('Injecting MetaMask Mesh testing client') + document.head.appendChild(testingContainer) +} From 58a554b1684fd78775b449b8f2b5d9635d30b69b Mon Sep 17 00:00:00 2001 From: Lazaridis Date: Sun, 11 Feb 2018 05:09:27 +0200 Subject: [PATCH 03/10] use the providers initial _blocktracker. fixes #2393 --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 63815ab65..428c78e2c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -444,7 +444,7 @@ module.exports = class MetamaskController extends EventEmitter { // create filter polyfill middleware const filterMiddleware = createFilterMiddleware({ provider: this.provider, - blockTracker: this.blockTracker, + blockTracker: this.provider._blockTracker, }) engine.push(createOriginMiddleware({ origin })) From 7a820bedda9b74ccc08f768597577ba839ef2c83 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 13 Feb 2018 13:35:03 -0800 Subject: [PATCH 04/10] Bump changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b44846e13..bfae566ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Fix bug where log subscriptions would break when switching network. + ## 3.14.1 2018-2-1 - Further fix scrolling for Firefox. From dc3f3e79ca7319b97255456a5225a266d38a4d6f Mon Sep 17 00:00:00 2001 From: frankiebee Date: Wed, 14 Feb 2018 14:37:02 -0800 Subject: [PATCH 05/10] fix - hex prefix estimatedGas on txMeta --- app/scripts/lib/tx-gas-utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/tx-gas-utils.js b/app/scripts/lib/tx-gas-utils.js index f68f3a9e2..6f6ff7852 100644 --- a/app/scripts/lib/tx-gas-utils.js +++ b/app/scripts/lib/tx-gas-utils.js @@ -4,6 +4,7 @@ const { BnMultiplyByFraction, bnToHex, } = require('./util') +const addHexPrefix = require('ethereumjs-util').addHexPrefix const SIMPLE_GAS_COST = '0x5208' // Hex for 21000, cost of a simple send. /* @@ -13,7 +14,7 @@ and used to do things like calculate gas of a tx. */ module.exports = class TxGasUtil { - + constructor (provider) { this.query = new EthQuery(provider) } @@ -68,7 +69,7 @@ module.exports = class TxGasUtil { } setTxGas (txMeta, blockGasLimitHex, estimatedGasHex) { - txMeta.estimatedGas = estimatedGasHex + txMeta.estimatedGas = addHexPrefix(estimatedGasHex) const txParams = txMeta.txParams // if gasLimit was specified and doesnt OOG, From a5056a62d1a8538049c182b4b104bcfb2645ad28 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 15 Feb 2018 12:04:19 -0800 Subject: [PATCH 06/10] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfae566ea..595bc00e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Current Master - Fix bug where log subscriptions would break when switching network. +- Add MetaMask light client [testing container](https://github.com/MetaMask/mesh-testing) ## 3.14.1 2018-2-1 From 71be537f1cdfe7df41e350f6720c12f5a7bb9b2d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 15 Feb 2018 14:23:22 -0800 Subject: [PATCH 07/10] Version 3.14.2 --- CHANGELOG.md | 3 +++ app/manifest.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 595bc00e6..fae2e0800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ ## Current Master +## 3.14.2 2018-2-15 + - Fix bug where log subscriptions would break when switching network. +- Fix bug where storage values were cached across blocks. - Add MetaMask light client [testing container](https://github.com/MetaMask/mesh-testing) ## 3.14.1 2018-2-1 diff --git a/app/manifest.json b/app/manifest.json index a0bb5acf6..3a80cc4fc 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.14.1", + "version": "3.14.2", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", From 70132e6df6de0722113f5b461b4cec2419c45266 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 15 Feb 2018 15:15:07 -0800 Subject: [PATCH 08/10] Default validated block gas limit to 8MM when none identified Mitigates #3266 --- ui/app/components/pending-tx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 32d54902e..eb6ece176 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -60,7 +60,7 @@ PendingTx.prototype.render = function () { // Gas const gas = txParams.gas const gasBn = hexToBn(gas) - const gasLimit = new BN(parseInt(blockGasLimit)) + const gasLimit = new BN(parseInt(blockGasLimit) || '8000000') // default to 8MM gas limit const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20) const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20) const safeGasLimit = safeGasLimitBN.toString(10) From 73e5ae6e29d04481cc3ffdd32d5d096e6a10b3b3 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 15 Feb 2018 15:32:48 -0800 Subject: [PATCH 09/10] Fix incorrect promise instantiation --- app/scripts/lib/nonce-tracker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js index 0029ac953..ed9dd3f11 100644 --- a/app/scripts/lib/nonce-tracker.js +++ b/app/scripts/lib/nonce-tracker.js @@ -56,7 +56,7 @@ class NonceTracker { const blockTracker = this._getBlockTracker() const currentBlock = blockTracker.getCurrentBlock() if (currentBlock) return currentBlock - return await Promise((reject, resolve) => { + return await new Promise((reject, resolve) => { blockTracker.once('latest', resolve) }) } From 8e80081966e6411fae41f398e063ac0a62fe415c Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 16 Feb 2018 07:50:51 -0800 Subject: [PATCH 10/10] lint - lift comment to new line --- ui/app/components/pending-tx.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index eb6ece176..98193ea6f 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -60,7 +60,8 @@ PendingTx.prototype.render = function () { // Gas const gas = txParams.gas const gasBn = hexToBn(gas) - const gasLimit = new BN(parseInt(blockGasLimit) || '8000000') // default to 8MM gas limit + // default to 8MM gas limit + const gasLimit = new BN(parseInt(blockGasLimit) || '8000000') const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20) const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20) const safeGasLimit = safeGasLimitBN.toString(10)