diff options
Estimate gas using same algorithm as backend.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 70ec3aed8..7a18b1c00 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -4,7 +4,6 @@ const getBuyEthUrl = require('../../app/scripts/lib/buy-eth-url') const { getTokenAddressFromTokenObject } = require('./util') const { calcGasTotal, - getParamsForGasEstimate, calcTokenBalance, estimateGas, estimateGasPriceFromRecentBlocks, @@ -725,12 +724,24 @@ function setGasTotal (gasTotal) { } } -function updateGasData ({ recentBlocks, selectedAddress, selectedToken, data }) { +function updateGasData ({ + blockGasLimit, + data, + recentBlocks, + selectedAddress, + selectedToken, + to, +}) { return (dispatch) => { - const estimateGasParams = getParamsForGasEstimate(selectedAddress, selectedToken, data) return Promise.all([ Promise.resolve(estimateGasPriceFromRecentBlocks(recentBlocks)), - estimateGas(estimateGasParams), + estimateGas({ + blockGasLimit, + data, + selectedAddress, + selectedToken, + to, + }), ]) .then(([gasPrice, gas]) => { dispatch(actions.setGasPrice(gasPrice)) |