diff --git a/src/templates/multisig/input.js b/src/templates/multisig/input.js index f8dd3d3..24a9710 100644 --- a/src/templates/multisig/input.js +++ b/src/templates/multisig/input.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const bscript = require("../../script"); const script_1 = require("../../script"); function partialSignature(value) { - return value === script_1.OPS.OP_0 || bscript.isCanonicalScriptSignature(value); + return (value === script_1.OPS.OP_0 || bscript.isCanonicalScriptSignature(value)); } function check(script, allowIncomplete) { const chunks = bscript.decompile(script); @@ -18,4 +18,6 @@ function check(script, allowIncomplete) { return chunks.slice(1).every(bscript.isCanonicalScriptSignature); } exports.check = check; -check.toJSON = function () { return 'multisig input'; }; +check.toJSON = function () { + return 'multisig input'; +}; diff --git a/src/templates/multisig/output.js b/src/templates/multisig/output.js index 811ed12..64d07bc 100644 --- a/src/templates/multisig/output.js +++ b/src/templates/multisig/output.js @@ -31,4 +31,6 @@ function check(script, allowIncomplete) { return keys.every(bscript.isCanonicalPubKey); } exports.check = check; -check.toJSON = function () { return 'multi-sig output'; }; +check.toJSON = function () { + return 'multi-sig output'; +}; diff --git a/src/templates/pubkey/input.js b/src/templates/pubkey/input.js index bc5e566..10d3c07 100644 --- a/src/templates/pubkey/input.js +++ b/src/templates/pubkey/input.js @@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); const bscript = require("../../script"); function check(script) { const chunks = bscript.decompile(script); - return chunks.length === 1 && - bscript.isCanonicalScriptSignature(chunks[0]); + return (chunks.length === 1 && bscript.isCanonicalScriptSignature(chunks[0])); } exports.check = check; -check.toJSON = function () { return 'pubKey input'; }; +check.toJSON = function () { + return 'pubKey input'; +}; diff --git a/src/templates/pubkey/output.js b/src/templates/pubkey/output.js index 043150e..e2f87c2 100644 --- a/src/templates/pubkey/output.js +++ b/src/templates/pubkey/output.js @@ -5,9 +5,11 @@ const bscript = require("../../script"); const script_1 = require("../../script"); function check(script) { const chunks = bscript.decompile(script); - return chunks.length === 2 && + return (chunks.length === 2 && bscript.isCanonicalPubKey(chunks[0]) && - chunks[1] === script_1.OPS.OP_CHECKSIG; + chunks[1] === script_1.OPS.OP_CHECKSIG); } exports.check = check; -check.toJSON = function () { return 'pubKey output'; }; +check.toJSON = function () { + return 'pubKey output'; +}; diff --git a/src/templates/pubkeyhash/input.js b/src/templates/pubkeyhash/input.js index 29a684e..f03d391 100644 --- a/src/templates/pubkeyhash/input.js +++ b/src/templates/pubkeyhash/input.js @@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); const bscript = require("../../script"); function check(script) { const chunks = bscript.decompile(script); - return chunks.length === 2 && + return (chunks.length === 2 && bscript.isCanonicalScriptSignature(chunks[0]) && - bscript.isCanonicalPubKey(chunks[1]); + bscript.isCanonicalPubKey(chunks[1])); } exports.check = check; -check.toJSON = function () { return 'pubKeyHash input'; }; +check.toJSON = function () { + return 'pubKeyHash input'; +}; diff --git a/src/templates/pubkeyhash/output.js b/src/templates/pubkeyhash/output.js index 9016c6a..222244b 100644 --- a/src/templates/pubkeyhash/output.js +++ b/src/templates/pubkeyhash/output.js @@ -5,12 +5,14 @@ const bscript = require("../../script"); const script_1 = require("../../script"); function check(script) { const buffer = bscript.compile(script); - return buffer.length === 25 && + return (buffer.length === 25 && buffer[0] === script_1.OPS.OP_DUP && buffer[1] === script_1.OPS.OP_HASH160 && buffer[2] === 0x14 && buffer[23] === script_1.OPS.OP_EQUALVERIFY && - buffer[24] === script_1.OPS.OP_CHECKSIG; + buffer[24] === script_1.OPS.OP_CHECKSIG); } exports.check = check; -check.toJSON = function () { return 'pubKeyHash output'; }; +check.toJSON = function () { + return 'pubKeyHash output'; +}; diff --git a/src/templates/scripthash/input.js b/src/templates/scripthash/input.js index c40bc26..5d2b576 100644 --- a/src/templates/scripthash/input.js +++ b/src/templates/scripthash/input.js @@ -24,8 +24,7 @@ function check(script, allowIncomplete) { return false; // is witness? if (chunks.length === 1) { - return p2wsho.check(redeemScriptChunks) || - p2wpkho.check(redeemScriptChunks); + return (p2wsho.check(redeemScriptChunks) || p2wpkho.check(redeemScriptChunks)); } // match types if (p2pkh.input.check(scriptSigChunks) && @@ -40,4 +39,6 @@ function check(script, allowIncomplete) { return false; } exports.check = check; -check.toJSON = function () { return 'scriptHash input'; }; +check.toJSON = function () { + return 'scriptHash input'; +}; diff --git a/src/templates/scripthash/output.js b/src/templates/scripthash/output.js index bd38d5a..5fd2f65 100644 --- a/src/templates/scripthash/output.js +++ b/src/templates/scripthash/output.js @@ -5,10 +5,12 @@ const bscript = require("../../script"); const script_1 = require("../../script"); function check(script) { const buffer = bscript.compile(script); - return buffer.length === 23 && + return (buffer.length === 23 && buffer[0] === script_1.OPS.OP_HASH160 && buffer[1] === 0x14 && - buffer[22] === script_1.OPS.OP_EQUAL; + buffer[22] === script_1.OPS.OP_EQUAL); } exports.check = check; -check.toJSON = function () { return 'scriptHash output'; }; +check.toJSON = function () { + return 'scriptHash output'; +}; diff --git a/src/templates/witnesscommitment/output.js b/src/templates/witnesscommitment/output.js index 95a8bc1..38f622a 100644 --- a/src/templates/witnesscommitment/output.js +++ b/src/templates/witnesscommitment/output.js @@ -8,13 +8,15 @@ const script_1 = require("../../script"); const HEADER = Buffer.from('aa21a9ed', 'hex'); function check(script) { const buffer = bscript.compile(script); - return buffer.length > 37 && + return (buffer.length > 37 && buffer[0] === script_1.OPS.OP_RETURN && buffer[1] === 0x24 && - buffer.slice(2, 6).equals(HEADER); + buffer.slice(2, 6).equals(HEADER)); } exports.check = check; -check.toJSON = function () { return 'Witness commitment output'; }; +check.toJSON = function () { + return 'Witness commitment output'; +}; function encode(commitment) { typeforce(types.Hash256bit, commitment); const buffer = Buffer.allocUnsafe(36); diff --git a/src/templates/witnesspubkeyhash/input.js b/src/templates/witnesspubkeyhash/input.js index 131a49e..4585623 100644 --- a/src/templates/witnesspubkeyhash/input.js +++ b/src/templates/witnesspubkeyhash/input.js @@ -7,9 +7,11 @@ function isCompressedCanonicalPubKey(pubKey) { } function check(script) { const chunks = bscript.decompile(script); - return chunks.length === 2 && + return (chunks.length === 2 && bscript.isCanonicalScriptSignature(chunks[0]) && - isCompressedCanonicalPubKey(chunks[1]); + isCompressedCanonicalPubKey(chunks[1])); } exports.check = check; -check.toJSON = function () { return 'witnessPubKeyHash input'; }; +check.toJSON = function () { + return 'witnessPubKeyHash input'; +}; diff --git a/src/templates/witnesspubkeyhash/output.js b/src/templates/witnesspubkeyhash/output.js index 2fb6e15..9c508a0 100644 --- a/src/templates/witnesspubkeyhash/output.js +++ b/src/templates/witnesspubkeyhash/output.js @@ -5,9 +5,9 @@ const bscript = require("../../script"); const script_1 = require("../../script"); function check(script) { const buffer = bscript.compile(script); - return buffer.length === 22 && - buffer[0] === script_1.OPS.OP_0 && - buffer[1] === 0x14; + return buffer.length === 22 && buffer[0] === script_1.OPS.OP_0 && buffer[1] === 0x14; } exports.check = check; -check.toJSON = function () { return 'Witness pubKeyHash output'; }; +check.toJSON = function () { + return 'Witness pubKeyHash output'; +}; diff --git a/src/templates/witnessscripthash/input.js b/src/templates/witnessscripthash/input.js index 255ea86..ca8c8b6 100644 --- a/src/templates/witnessscripthash/input.js +++ b/src/templates/witnessscripthash/input.js @@ -31,4 +31,6 @@ function check(chunks, allowIncomplete) { return false; } exports.check = check; -check.toJSON = function () { return 'witnessScriptHash input'; }; +check.toJSON = function () { + return 'witnessScriptHash input'; +}; diff --git a/src/templates/witnessscripthash/output.js b/src/templates/witnessscripthash/output.js index 994a75a..f283b86 100644 --- a/src/templates/witnessscripthash/output.js +++ b/src/templates/witnessscripthash/output.js @@ -5,9 +5,9 @@ const bscript = require("../../script"); const script_1 = require("../../script"); function check(script) { const buffer = bscript.compile(script); - return buffer.length === 34 && - buffer[0] === script_1.OPS.OP_0 && - buffer[1] === 0x20; + return buffer.length === 34 && buffer[0] === script_1.OPS.OP_0 && buffer[1] === 0x20; } exports.check = check; -check.toJSON = function () { return 'Witness scriptHash output'; }; +check.toJSON = function () { + return 'Witness scriptHash output'; +}; diff --git a/types/templates/multisig/index.d.ts b/types/templates/multisig/index.d.ts index cff90ee..f6288e2 100644 --- a/types/templates/multisig/index.d.ts +++ b/types/templates/multisig/index.d.ts @@ -1,3 +1,3 @@ import * as input from './input'; import * as output from './output'; -export { input, output, }; +export { input, output }; diff --git a/types/templates/pubkey/index.d.ts b/types/templates/pubkey/index.d.ts index cff90ee..f6288e2 100644 --- a/types/templates/pubkey/index.d.ts +++ b/types/templates/pubkey/index.d.ts @@ -1,3 +1,3 @@ import * as input from './input'; import * as output from './output'; -export { input, output, }; +export { input, output }; diff --git a/types/templates/pubkeyhash/index.d.ts b/types/templates/pubkeyhash/index.d.ts index cff90ee..f6288e2 100644 --- a/types/templates/pubkeyhash/index.d.ts +++ b/types/templates/pubkeyhash/index.d.ts @@ -1,3 +1,3 @@ import * as input from './input'; import * as output from './output'; -export { input, output, }; +export { input, output }; diff --git a/types/templates/scripthash/index.d.ts b/types/templates/scripthash/index.d.ts index cff90ee..f6288e2 100644 --- a/types/templates/scripthash/index.d.ts +++ b/types/templates/scripthash/index.d.ts @@ -1,3 +1,3 @@ import * as input from './input'; import * as output from './output'; -export { input, output, }; +export { input, output }; diff --git a/types/templates/witnesscommitment/index.d.ts b/types/templates/witnesscommitment/index.d.ts index a072ea9..c37ee7c 100644 --- a/types/templates/witnesscommitment/index.d.ts +++ b/types/templates/witnesscommitment/index.d.ts @@ -1,2 +1,2 @@ import * as output from './output'; -export { output, }; +export { output }; diff --git a/types/templates/witnesspubkeyhash/index.d.ts b/types/templates/witnesspubkeyhash/index.d.ts index cff90ee..f6288e2 100644 --- a/types/templates/witnesspubkeyhash/index.d.ts +++ b/types/templates/witnesspubkeyhash/index.d.ts @@ -1,3 +1,3 @@ import * as input from './input'; import * as output from './output'; -export { input, output, }; +export { input, output }; diff --git a/types/templates/witnessscripthash/index.d.ts b/types/templates/witnessscripthash/index.d.ts index cff90ee..f6288e2 100644 --- a/types/templates/witnessscripthash/index.d.ts +++ b/types/templates/witnessscripthash/index.d.ts @@ -1,3 +1,3 @@ import * as input from './input'; import * as output from './output'; -export { input, output, }; +export { input, output };