From b4052cd5e65c1d6ac0c81b051ddf59505a480ec6 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 8 Aug 2017 23:34:18 -0700 Subject: tx utils - detect estimateGas err and set simulationFailed --- app/scripts/lib/tx-utils.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js index b64ea6712..5af078dc4 100644 --- a/app/scripts/lib/tx-utils.js +++ b/app/scripts/lib/tx-utils.js @@ -20,7 +20,15 @@ module.exports = class txProvideUtil { async analyzeGasUsage (txMeta) { const block = await this.query.getBlockByNumber('latest', true) - const estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit) + let estimatedGasHex + try { + estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit) + } catch (err) { + if (err.message.includes('Transaction execution error.')) { + txMeta.simulationFails = true + return txMeta + } + } this.setTxGas(txMeta, block.gasLimit, estimatedGasHex) return txMeta } @@ -35,8 +43,8 @@ module.exports = class txProvideUtil { const saferGasLimitBN = BnMultiplyByFraction(blockGasLimitBN, 19, 20) txParams.gas = bnToHex(saferGasLimitBN) } - // run tx, see if it will OOG - return this.query.estimateGas(txParams) + // run tx + return await this.query.estimateGas(txParams) } setTxGas (txMeta, blockGasLimitHex, estimatedGasHex) { -- cgit From 245125eb18a03f3ea91fa43a90ad59e628471d62 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 9 Aug 2017 12:25:38 -0700 Subject: ui - buy eth - formatting and moved network names to config --- app/scripts/config.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index 8e28db80e..c5f260583 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -12,4 +12,9 @@ module.exports = { kovan: KOVAN_RPC_URL, rinkeby: RINKEBY_RPC_URL, }, + networkNames: { + 3: 'Ropsten', + 4: 'Rinkeby', + 42: 'Kovan', + }, } -- cgit From 2b409fb60b3f524a852a895c9d184fc2bf829009 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 9 Aug 2017 23:05:50 -0700 Subject: 3.9.6 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 3b9194eb9..f34bdcec3 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.9.5", + "version": "3.9.6", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", -- cgit From ac9e84ff40c0331cda6233be31241d68f05565f3 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Fri, 11 Aug 2017 15:52:03 -0700 Subject: add deprecation warning for web3 --- app/scripts/lib/auto-reload.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js index 534047330..dabf4278e 100644 --- a/app/scripts/lib/auto-reload.js +++ b/app/scripts/lib/auto-reload.js @@ -5,7 +5,10 @@ function setupDappAutoReload (web3, observable) { global.web3 = new Proxy(web3, { get: (_web3, name) => { // get the time of use - if (name !== '_used') _web3._used = Date.now() + if (name !== '_used') { + console.warn('MetaMask: web3 will be deprecated in the future in favor of the ethereumProvider \nhttps://github.com/ethereum/mist/releases/tag/v0.9.0') + _web3._used = Date.now() + } return _web3[name] }, set: (_web3, name, value) => { -- cgit From 66a012550edb8b8bb328f2315109bbbab48d3d3f Mon Sep 17 00:00:00 2001 From: frankiebee Date: Fri, 11 Aug 2017 15:54:52 -0700 Subject: fix wording --- app/scripts/lib/auto-reload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js index dabf4278e..6abce73ea 100644 --- a/app/scripts/lib/auto-reload.js +++ b/app/scripts/lib/auto-reload.js @@ -6,7 +6,7 @@ function setupDappAutoReload (web3, observable) { get: (_web3, name) => { // get the time of use if (name !== '_used') { - console.warn('MetaMask: web3 will be deprecated in the future in favor of the ethereumProvider \nhttps://github.com/ethereum/mist/releases/tag/v0.9.0') + console.warn('MetaMask: web3 will be deprecated in the near future in favor of the ethereumProvider \nhttps://github.com/ethereum/mist/releases/tag/v0.9.0') _web3._used = Date.now() } return _web3[name] -- cgit