-
Notifications
You must be signed in to change notification settings - Fork 758
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
replace toBuffer => toArrayLike #163
Conversation
here is more details about the issue indutny/bn.js#147
Oh seems like this is the only case left using |
@@ -71,7 +71,7 @@ module.exports = function (opts, cb) { | |||
stateManager.getAccount(createdAddress, function (err, account) { | |||
toAccount = account | |||
const NONCE_OFFSET = 1 | |||
toAccount.nonce = new BN(toAccount.nonce).addn(NONCE_OFFSET).toBuffer() | |||
toAccount.nonce = new BN(toAccount.nonce).addn(NONCE_OFFSET).toArrayLike(Buffer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, hold on a second. We need to define the endianess and size of the nonce field. Probably toArrayLike(Buffer, 'be')
is the correct one, because RLP will remove the zeroes anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axic I think if toBuffer
worked correct, toArrayLike(Buffer)
also will work correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, because it defualts to be
and RLP will remove any leading zeroes.
Pin ethjs-util version exactly
Added verifyPublicKey to verify publicKey, privateKey pair.
here is more details about the issue indutny/bn.js#147