Strip the r and s (since we not pad) for transactions.

This commit is contained in:
Richard Moore 2018-06-20 22:03:23 -04:00
parent 5631f071c3
commit 2feced5937
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
2 changed files with 4 additions and 4 deletions

@ -55,8 +55,8 @@ function SigningKey(privateKey) {
utils.defineProperty(this, 'signDigest', function(digest) { utils.defineProperty(this, 'signDigest', function(digest) {
var signature = keyPair.sign(utils.arrayify(digest), {canonical: true}); var signature = keyPair.sign(utils.arrayify(digest), {canonical: true});
const r = '0x' + signature.r.toString(16); var r = '0x' + signature.r.toString(16);
const s = '0x' + signature.s.toString(16); var s = '0x' + signature.s.toString(16);
return { return {
recoveryParam: signature.recoveryParam, recoveryParam: signature.recoveryParam,

@ -133,8 +133,8 @@ function Wallet(privateKey, provider) {
} }
raw.push(utils.hexlify(v)); raw.push(utils.hexlify(v));
raw.push(signature.r); raw.push(utils.stripZeros(utils.arrayify(signature.r)));
raw.push(signature.s); raw.push(utils.stripZeros(utils.arrayify(signature.s)));
return utils.RLP.encode(raw); return utils.RLP.encode(raw);
}); });