diff options
author | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-14 17:06:14 +0800 |
---|---|---|
committer | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-14 17:06:14 +0800 |
commit | dbc539ac558958fee339cb1ab43202385d98d089 (patch) | |
tree | 00296e883ff128f141df51915650fd5075f9cdd7 /app | |
parent | 2eadf72fb772b5b6bd32f04c9d439cc0f1ab0453 (diff) | |
parent | 68c6b2d666719476bff78cbc107a56be3b86dbe1 (diff) | |
download | tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.tar tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.tar.gz tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.tar.bz2 tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.tar.lz tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.tar.xz tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.tar.zst tangerine-wallet-browser-dbc539ac558958fee339cb1ab43202385d98d089.zip |
Merge remote-tracking branch 'mm/master' into NewUI-flat
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 2 | ||||
-rw-r--r-- | app/scripts/config.js | 5 | ||||
-rw-r--r-- | app/scripts/lib/auto-reload.js | 5 | ||||
-rw-r--r-- | app/scripts/lib/tx-utils.js | 14 |
4 files changed, 21 insertions, 5 deletions
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", 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', + }, } diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js index 534047330..6abce73ea 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 near 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) => { 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) { |