Remove erroneous OOG estimation logic.

feature/default_network_editable
Dan Finlay 8 years ago
parent 2dc87b4bd4
commit 21e2e4efd8
  1. 17
      app/scripts/lib/tx-utils.js

@ -20,7 +20,6 @@ module.exports = class txProviderUtils {
if (err) return cb(err)
async.waterfall([
self.estimateTxGas.bind(self, txData, block.gasLimit),
self.checkForTxGasError.bind(self, txData),
self.setTxGas.bind(self, txData, block.gasLimit),
], cb)
})
@ -38,22 +37,10 @@ module.exports = class txProviderUtils {
this.query.estimateGas(txParams, cb)
}
checkForTxGasError (txData, estimatedGasHex, cb) {
setTxGas (txData, blockGasLimitHex, estimatedGasHex, cb) {
txData.estimatedGas = estimatedGasHex
// all gas used - must be an error
if (estimatedGasHex === txData.txParams.gas) {
txData.simulationFails = true
}
cb()
}
setTxGas (txData, blockGasLimitHex, cb) {
const txParams = txData.txParams
// if OOG, nothing more to do
if (txData.simulationFails) {
cb()
return
}
// if gasLimit was specified and doesnt OOG,
// use original specified amount
if (txData.gasLimitSpecified) {

Loading…
Cancel
Save