I have a contract that is doing an ecrecover:
function recover(bytes32 h, uint8 v, bytes32 r, bytes32 s) public returns (address) {
return ecrecover(h, v, r, s);
}
It works fine in my truffle unit tests
console.log(await ecdsa.recover.call('0xbec921276c8067fe0c82def3e5ecfd8447f1961bc85768c2a56e6bd26d3c0c53', '0x1b', '0x6c5b9b4deb51a4733784657abac3e1dcef04086979a500397456b948981ccbc1', '0x2944200fb10074295baa04db6c048dc120ee9f3b48a42cbe4223242f07cc8e85'));
But when I use [email protected] and the contract ABI in NodeJs I receive an error:
const contract = new this.web3.eth.Contract(this.abi.abi, this.abi.networks['5777'].address);
await contract.methods.recover.call('0xbec921276c8067fe0c82def3e5ecfd8447f1961bc85768c2a56e6bd26d3c0c53', '0x1b', '0x6c5b9b4deb51a4733784657abac3e1dcef04086979a500397456b948981ccbc1', '0x2944200fb10074295baa04db6c048dc120ee9f3b48a42cbe4223242f07cc8e85', (err, result) => { console.log(err); console.log(result);});
{ Error: types/values length mismatch (count={"types":4,"values":0}, value={"types":[{"name":"h","type":"bytes32"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"values":[]}, version=4.0.27)