diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-06-15 06:35:37 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-06-15 06:35:37 +0800 |
commit | 1fe383f7fb82bf96e1709abb59ec25689e7a5bc7 (patch) | |
tree | c7ef114dff5e53931698f33a42d3d214176ac15c | |
parent | f599f9ad29a06ca932f2073f4eb9748da625a8f3 (diff) | |
download | tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.tar tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.tar.gz tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.tar.bz2 tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.tar.lz tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.tar.xz tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.tar.zst tangerine-wallet-browser-1fe383f7fb82bf96e1709abb59ec25689e7a5bc7.zip |
Fix signature concatenation
Fixes #280
Or at least, it should. Is this what you were requesting, @denisgranha?
-rw-r--r-- | app/scripts/lib/idStore.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 33d842d54..486c67be6 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -513,10 +513,17 @@ function IdManagement(opts) { function noop(){} +function pad_with_zeroes(number, length){ + var my_string = '' + number; + while (my_string.length < length) { + my_string = '0' + my_string; + } + return my_string; +} function concatSig(v, r, s) { - r = ethUtil.fromSigned(r) - s = ethUtil.fromSigned(s) + r = pad_with_zeroes(ethUtil.fromSigned(r)) + s = pad_with_zeroes(ethUtil.fromSigned(s)) v = ethUtil.bufferToInt(v) r = ethUtil.toUnsigned(r).toString('hex') s = ethUtil.toUnsigned(s).toString('hex') |