Fix lint for script_number.ts script_signature.ts

This commit is contained in:
junderw 2019-03-07 13:21:18 +09:00
parent c2c650812e
commit 94f3348519
No known key found for this signature in database
GPG key ID: B256185D3A971908
5 changed files with 21 additions and 25 deletions

View file

@ -29,13 +29,11 @@ function decode(buffer) {
const hashTypeMod = hashType & ~0x80;
if (hashTypeMod <= 0 || hashTypeMod >= 4)
throw new Error('Invalid hashType ' + hashType);
const decode = bip66.decode(buffer.slice(0, -1));
const r = fromDER(decode.r);
const s = fromDER(decode.s);
return {
signature: Buffer.concat([r, s], 64),
hashType: hashType,
};
const decoded = bip66.decode(buffer.slice(0, -1));
const r = fromDER(decoded.r);
const s = fromDER(decoded.s);
const signature = Buffer.concat([r, s], 64);
return { signature, hashType };
}
exports.decode = decode;
function encode(signature, hashType) {