From 2feced5937b36bf9846cca1c65a81f4a5e1cdcc5 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Wed, 20 Jun 2018 22:03:23 -0400 Subject: [PATCH] Strip the r and s (since we not pad) for transactions. --- wallet/signing-key.js | 4 ++-- wallet/wallet.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wallet/signing-key.js b/wallet/signing-key.js index fce420082..39c7b10cf 100644 --- a/wallet/signing-key.js +++ b/wallet/signing-key.js @@ -55,8 +55,8 @@ function SigningKey(privateKey) { utils.defineProperty(this, 'signDigest', function(digest) { var signature = keyPair.sign(utils.arrayify(digest), {canonical: true}); - const r = '0x' + signature.r.toString(16); - const s = '0x' + signature.s.toString(16); + var r = '0x' + signature.r.toString(16); + var s = '0x' + signature.s.toString(16); return { recoveryParam: signature.recoveryParam, diff --git a/wallet/wallet.js b/wallet/wallet.js index babb1c3f4..53f1c710e 100644 --- a/wallet/wallet.js +++ b/wallet/wallet.js @@ -133,8 +133,8 @@ function Wallet(privateKey, provider) { } raw.push(utils.hexlify(v)); - raw.push(signature.r); - raw.push(signature.s); + raw.push(utils.stripZeros(utils.arrayify(signature.r))); + raw.push(utils.stripZeros(utils.arrayify(signature.s))); return utils.RLP.encode(raw); });