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); });