diff --git a/src/payments/p2ms.js b/src/payments/p2ms.js index 4e3c115..1e51faa 100644 --- a/src/payments/p2ms.js +++ b/src/payments/p2ms.js @@ -25,7 +25,7 @@ function p2ms(a, opts) { opts = Object.assign({ validate: true }, opts || {}); function isAcceptableSignature(x) { return (bscript.isCanonicalScriptSignature(x) || - (opts.allowIncomplete && x === OPS.OP_0) !== undefined); // eslint-disable-line + (opts.allowIncomplete && x === OPS.OP_0) !== undefined); } typef({ network: typef.maybe(typef.Object), @@ -45,8 +45,8 @@ function p2ms(a, opts) { return; decoded = true; chunks = bscript.decompile(output); - o.m = chunks[0] - OP_INT_BASE; // eslint-disable-line - o.n = chunks[chunks.length - 2] - OP_INT_BASE; // eslint-disable-line + o.m = chunks[0] - OP_INT_BASE; + o.n = chunks[chunks.length - 2] - OP_INT_BASE; o.pubkeys = chunks.slice(1, -2); } lazy.prop(o, 'output', function () { @@ -100,10 +100,7 @@ function p2ms(a, opts) { throw new TypeError('Output is invalid'); if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) throw new TypeError('Output is invalid'); - if (o.m <= 0 || // eslint-disable-line - o.n > 16 || // eslint-disable-line - o.m > o.n || // eslint-disable-line - o.n !== chunks.length - 3) + if (o.m <= 0 || o.n > 16 || o.m > o.n || o.n !== chunks.length - 3) throw new TypeError('Output is invalid'); if (!o.pubkeys.every(x => ecc.isPoint(x))) throw new TypeError('Output is invalid'); diff --git a/src/payments/p2sh.js b/src/payments/p2sh.js index bb8f0a0..f98ef71 100644 --- a/src/payments/p2sh.js +++ b/src/payments/p2sh.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const networks_1 = require("../networks"); // eslint-disable-line +const networks_1 = require("../networks"); const bscript = require("../script"); const bcrypto = require("../crypto"); const lazy = require("./lazy"); diff --git a/src/payments/p2wsh.js b/src/payments/p2wsh.js index c5eb067..7c71ac3 100644 --- a/src/payments/p2wsh.js +++ b/src/payments/p2wsh.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const networks_1 = require("../networks"); // eslint-disable-line +const networks_1 = require("../networks"); const bscript = require("../script"); const bcrypto = require("../crypto"); const lazy = require("./lazy"); diff --git a/test/ecpair.js b/test/ecpair.js index 4299470..0ff0e8b 100644 --- a/test/ecpair.js +++ b/test/ecpair.js @@ -1,5 +1,3 @@ -/* eslint-disable no-new */ - const { describe, it, beforeEach } = require('mocha') const assert = require('assert') const proxyquire = require('proxyquire') diff --git a/ts_src/payments/embed.ts b/ts_src/payments/embed.ts index f7225a7..d7a2b0f 100644 --- a/ts_src/payments/embed.ts +++ b/ts_src/payments/embed.ts @@ -1,4 +1,4 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; import * as bscript from '../script'; import * as lazy from './lazy'; import { bitcoin as BITCOIN_NETWORK } from '../networks'; diff --git a/ts_src/payments/index.ts b/ts_src/payments/index.ts index 9791661..6727eeb 100644 --- a/ts_src/payments/index.ts +++ b/ts_src/payments/index.ts @@ -1,4 +1,4 @@ -import { Network } from '../networks'; // eslint-disable-line +import { Network } from '../networks'; import { p2data as embed } from './embed'; import { p2ms } from './p2ms'; import { p2pk } from './p2pk'; diff --git a/ts_src/payments/p2ms.ts b/ts_src/payments/p2ms.ts index fce7616..766f341 100644 --- a/ts_src/payments/p2ms.ts +++ b/ts_src/payments/p2ms.ts @@ -1,4 +1,4 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; import * as bscript from '../script'; import * as lazy from './lazy'; import { bitcoin as BITCOIN_NETWORK } from '../networks'; @@ -32,7 +32,7 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment { return ( bscript.isCanonicalScriptSignature(x) || (opts!.allowIncomplete && x === OPS.OP_0) !== undefined - ); // eslint-disable-line + ); } typef( @@ -58,8 +58,8 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment { if (decoded) return; decoded = true; chunks = >bscript.decompile(output); - o.m = chunks[0] - OP_INT_BASE; // eslint-disable-line - o.n = chunks[chunks.length - 2] - OP_INT_BASE; // eslint-disable-line + o.m = chunks[0] - OP_INT_BASE; + o.n = chunks[chunks.length - 2] - OP_INT_BASE; o.pubkeys = >chunks.slice(1, -2); } @@ -115,12 +115,7 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment { if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) throw new TypeError('Output is invalid'); - if ( - o.m! <= 0 || // eslint-disable-line - o.n! > 16 || // eslint-disable-line - o.m! > o.n! || // eslint-disable-line - o.n !== chunks.length - 3 - ) + if (o.m! <= 0 || o.n! > 16 || o.m! > o.n! || o.n !== chunks.length - 3) throw new TypeError('Output is invalid'); if (!o.pubkeys!.every(x => ecc.isPoint(x))) throw new TypeError('Output is invalid'); diff --git a/ts_src/payments/p2pk.ts b/ts_src/payments/p2pk.ts index e17a8f2..69fb404 100644 --- a/ts_src/payments/p2pk.ts +++ b/ts_src/payments/p2pk.ts @@ -1,4 +1,4 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; import * as bscript from '../script'; import * as lazy from './lazy'; import { bitcoin as BITCOIN_NETWORK } from '../networks'; diff --git a/ts_src/payments/p2pkh.ts b/ts_src/payments/p2pkh.ts index ccac25d..63594ad 100644 --- a/ts_src/payments/p2pkh.ts +++ b/ts_src/payments/p2pkh.ts @@ -1,4 +1,4 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; import * as bscript from '../script'; import * as bcrypto from '../crypto'; import * as lazy from './lazy'; diff --git a/ts_src/payments/p2sh.ts b/ts_src/payments/p2sh.ts index b2e6bdf..b7df1dc 100644 --- a/ts_src/payments/p2sh.ts +++ b/ts_src/payments/p2sh.ts @@ -1,5 +1,5 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line -import { bitcoin as BITCOIN_NETWORK } from '../networks'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; +import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bscript from '../script'; import * as bcrypto from '../crypto'; import * as lazy from './lazy'; diff --git a/ts_src/payments/p2wpkh.ts b/ts_src/payments/p2wpkh.ts index ec7ed40..04f0e92 100644 --- a/ts_src/payments/p2wpkh.ts +++ b/ts_src/payments/p2wpkh.ts @@ -1,4 +1,4 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; import * as bscript from '../script'; import * as bcrypto from '../crypto'; import * as lazy from './lazy'; diff --git a/ts_src/payments/p2wsh.ts b/ts_src/payments/p2wsh.ts index 78e842d..28a235c 100644 --- a/ts_src/payments/p2wsh.ts +++ b/ts_src/payments/p2wsh.ts @@ -1,5 +1,5 @@ -import { Payment, PaymentOpts } from './index'; // eslint-disable-line -import { bitcoin as BITCOIN_NETWORK } from '../networks'; // eslint-disable-line +import { Payment, PaymentOpts } from './index'; +import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bscript from '../script'; import * as bcrypto from '../crypto'; import * as lazy from './lazy';