Web3.js: parity: web3.eth.personal.unlockAccount: integer to hex conversion not working?

Created on 14 Jan 2019  路  5Comments  路  Source: ChainSafe/web3.js

I am having problems to unlock my account with a parity node. It seems like that the integer I am passing in web3.eth.personal.unlockAccount('...', '...', 10000) is not converted to a hex and send to the parity endpoint. I am having no problems with geth but thisParity issue send me over here.

Could somebody confirm that this is not a problem with web3?

The error message I received is:

UnhandledPromiseRejectionWarning: Error: Returned error: Invalid params: invalid type: integer 10000, expected a 0x-prefixed, hex-encoded number of length 32.

2.x Stale bug on hold

Most helpful comment

That's true there is a missing mapping for the duration property of the unlockAccount method. Thanks for submitting this issue. I will add this fix as soon as possible.

All 5 comments

That's true there is a missing mapping for the duration property of the unlockAccount method. Thanks for submitting this issue. I will add this fix as soon as possible.

I have the same problem

I've checked it and web3.js can't handle this in a clean way because parity will have the number as hex string and geth as number.
The only solution would be to create a web3.eth.personal.parityUnlockAccount() method until parity or geth has changed it. I will open an issue in the geth and parity repository for syncing this.

So how do we unlock accounts now with parity?

EDIT: If anyone stumbles over the same problem, just use null as the duration parameter.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

praveengupta0895 picture praveengupta0895  路  3Comments

FradSer picture FradSer  路  3Comments

baxy picture baxy  路  3Comments

SCBuergel picture SCBuergel  路  3Comments

xpepermint picture xpepermint  路  3Comments