Merge pull request #124 from ethereum/fix-estimategas

UDapp: don't supply a hardcoded limit to estimageGas, but judge based on the response
pull/1/head
Alex Beregszaszi 9 years ago committed by GitHub
commit d66a7a48d5
  1. 5
      src/universal-dapp.js

@ -635,7 +635,6 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
from: self.options.getAddress ? self.options.getAddress() : self.web3.eth.accounts[0],
to: to,
data: data,
gas: gas,
value: value
};
if (constant && !isConstructor) {
@ -646,6 +645,10 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
return cb(err, resp);
}
if (resp > gas) {
return cb('Gas required exceeds limit: ' + resp);
}
tx.gas = resp;
self.web3.eth.sendTransaction(tx, function (err, resp) {

Loading…
Cancel
Save