Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecRecover issue, please help #2565

Closed
xiongzhend opened this issue Mar 25, 2019 · 0 comments · Fixed by #2567
Closed

ecRecover issue, please help #2565

xiongzhend opened this issue Mar 25, 2019 · 0 comments · Fixed by #2567
Labels
Bug Addressing a bug

Comments

@xiongzhend
Copy link

xiongzhend commented Mar 25, 2019

I am trying to use ecRecover in 1.0.0-beta.50, not working!

I expected to get the recoveredAddress, but get Error

code is here

·
var account_address = '0x3Df7a01f4CE7d6F9870325B219647daFF3f3467c';
var message = '8dfe9be33ccb1c830e048219729e8c01f54c768004d8dc035105629515feb38e';
console.log(message.length);
var messageBuffer = new Buffer(message, 'hex');
console.log('message: ' + message);
web3.eth.personal.sign(message, account_address, '123456').then(result => {
console.log('signature: ' + result);
var pub = web3.eth.personal.ecRecover(message, result).then(recoveredAddress => {
console.log('recoveredAddress: ' + recoveredAddress);
console.log('isMatch: ' + recoveredAddress === account_address);
});
});
·

Error Logs

(node:8572) UnhandledPromiseRejectionWarning: Error: Invalid Arguments length: expected: 3, given: 2......

Versions

  • web3.js: 1.0.0-beta.50
  • nodejs: 8.14.0
  • browser: no
  • ethereum node: 1.8.23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants