Is there a way to call a contract with no arguments using async? Contract code:
contract A {
function test() constant returns(string s, address addr) {
s = "Success!";
addr = msg.sender;
}
}
Here is the js code:
async.waterfall([
function getResult(cb) {
contractObject = web3.eth.contract(abi);
contractInstance = contractObject.at(address);
contractInstance.test.call(
function(err,getOutput) {
if(err) {console.log(err);}
var gotOutput = getOutput;
console.log('Test result received: ' + getOutput);
return cb(null,gotOutput);
});
}
], function asyncComplete(err, getResult) {
if (err) {console.log(err);}
var result = [];
result.push({ result: getResult[0], address: getResult[1]});
console.log(result);
})
The error I am currently seeing when I execute the above code against testrpc, is
BigNumber Error: new BigNumber() not a base 16 number:
Any suggestions on how to get around this error?