diff options
author | Dan J Miller <danjm.com@gmail.com> | 2018-06-05 03:08:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 03:08:01 +0800 |
commit | 139f930185f134ef50d547ca07a580e11b5cf731 (patch) | |
tree | 4e184b7dc5f97d9d4da28e6b72b256e955b0a937 /app/scripts | |
parent | 2ca084b0557242b34733107701a14ba0724363b3 (diff) | |
parent | ada59054c9d102cc99b950f1377256cac5545649 (diff) | |
download | tangerine-wallet-browser-139f930185f134ef50d547ca07a580e11b5cf731.tar.gz tangerine-wallet-browser-139f930185f134ef50d547ca07a580e11b5cf731.tar.zst tangerine-wallet-browser-139f930185f134ef50d547ca07a580e11b5cf731.zip |
Merge pull request #4350 from MetaMask/i3914-fix-newui-send-gas-estimation
NewUI gas estimation produces same results as old-ui (exception: contract addresses)
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/metamask-controller.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index a570f2567..9db7e186a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -384,6 +384,8 @@ module.exports = class MetamaskController extends EventEmitter { updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController), retryTransaction: nodeify(this.retryTransaction, this), getFilteredTxList: nodeify(txController.getFilteredTxList, txController), + isNonceTaken: nodeify(txController.isNonceTaken, txController), + estimateGas: nodeify(this.estimateGas, this), // messageManager signMessage: nodeify(this.signMessage, this), @@ -922,6 +924,18 @@ module.exports = class MetamaskController extends EventEmitter { return state } + estimateGas (estimateGasParams) { + return new Promise((resolve, reject) => { + return this.txController.txGasUtil.query.estimateGas(estimateGasParams, (err, res) => { + if (err) { + return reject(err) + } + + return resolve(res) + }) + }) + } + //============================================================================= // PASSWORD MANAGEMENT //============================================================================= |