Commit 1a95783e authored by d11e9's avatar d11e9

fix web3 issues

parent 6a712241
...@@ -306,14 +306,19 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { ...@@ -306,14 +306,19 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
var func = web3.eth.contract( [args.abi] ).at( to ); var func = web3.eth.contract( [args.abi] ).at( to );
func[args.abi.name].call( cb ); func[args.abi.name].call( cb );
} else { } else {
web3.eth.sendTransaction({ var tx = {
from: web3.eth.accounts[0], from: web3.eth.accounts[0],
to: to, to: to,
data: data, data: data,
gas: 1000000 gas: 1000000
}, function(err, resp) { }
cb( err, resp ); web3.eth.estimateGas( tx, function(err, resp){
}); tx.gas = resp;
if (!err) web3.eth.sendTransaction( tx, function(err, resp) {
cb( err, resp );
});
else cb( err, resp);
})
} }
} else { } else {
try { try {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment