mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Fix signature concatenation
Fixes #280 Or at least, it should. Is this what you were requesting, @denisgranha?
This commit is contained in:
parent
f599f9ad29
commit
1fe383f7fb
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user