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

@ -33,14 +33,12 @@ export function decode(buffer: Buffer): ScriptSignature {
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);
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: Buffer.concat([r, s], 64),
hashType: hashType,
};
return { signature, hashType };
}
export function encode(signature: Buffer, hashType: number): Buffer {