Remove eslint comments.
This commit is contained in:
parent
763cb8b923
commit
0729fde36f
12 changed files with 20 additions and 30 deletions
|
@ -25,7 +25,7 @@ function p2ms(a, opts) {
|
||||||
opts = Object.assign({ validate: true }, opts || {});
|
opts = Object.assign({ validate: true }, opts || {});
|
||||||
function isAcceptableSignature(x) {
|
function isAcceptableSignature(x) {
|
||||||
return (bscript.isCanonicalScriptSignature(x) ||
|
return (bscript.isCanonicalScriptSignature(x) ||
|
||||||
(opts.allowIncomplete && x === OPS.OP_0) !== undefined); // eslint-disable-line
|
(opts.allowIncomplete && x === OPS.OP_0) !== undefined);
|
||||||
}
|
}
|
||||||
typef({
|
typef({
|
||||||
network: typef.maybe(typef.Object),
|
network: typef.maybe(typef.Object),
|
||||||
|
@ -45,8 +45,8 @@ function p2ms(a, opts) {
|
||||||
return;
|
return;
|
||||||
decoded = true;
|
decoded = true;
|
||||||
chunks = bscript.decompile(output);
|
chunks = bscript.decompile(output);
|
||||||
o.m = chunks[0] - OP_INT_BASE; // eslint-disable-line
|
o.m = chunks[0] - OP_INT_BASE;
|
||||||
o.n = chunks[chunks.length - 2] - OP_INT_BASE; // eslint-disable-line
|
o.n = chunks[chunks.length - 2] - OP_INT_BASE;
|
||||||
o.pubkeys = chunks.slice(1, -2);
|
o.pubkeys = chunks.slice(1, -2);
|
||||||
}
|
}
|
||||||
lazy.prop(o, 'output', function () {
|
lazy.prop(o, 'output', function () {
|
||||||
|
@ -100,10 +100,7 @@ function p2ms(a, opts) {
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG)
|
if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG)
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
if (o.m <= 0 || // eslint-disable-line
|
if (o.m <= 0 || o.n > 16 || o.m > o.n || o.n !== chunks.length - 3)
|
||||||
o.n > 16 || // eslint-disable-line
|
|
||||||
o.m > o.n || // eslint-disable-line
|
|
||||||
o.n !== chunks.length - 3)
|
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
if (!o.pubkeys.every(x => ecc.isPoint(x)))
|
if (!o.pubkeys.every(x => ecc.isPoint(x)))
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const networks_1 = require("../networks"); // eslint-disable-line
|
const networks_1 = require("../networks");
|
||||||
const bscript = require("../script");
|
const bscript = require("../script");
|
||||||
const bcrypto = require("../crypto");
|
const bcrypto = require("../crypto");
|
||||||
const lazy = require("./lazy");
|
const lazy = require("./lazy");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const networks_1 = require("../networks"); // eslint-disable-line
|
const networks_1 = require("../networks");
|
||||||
const bscript = require("../script");
|
const bscript = require("../script");
|
||||||
const bcrypto = require("../crypto");
|
const bcrypto = require("../crypto");
|
||||||
const lazy = require("./lazy");
|
const lazy = require("./lazy");
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable no-new */
|
|
||||||
|
|
||||||
const { describe, it, beforeEach } = require('mocha')
|
const { describe, it, beforeEach } = require('mocha')
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const proxyquire = require('proxyquire')
|
const proxyquire = require('proxyquire')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Network } from '../networks'; // eslint-disable-line
|
import { Network } from '../networks';
|
||||||
import { p2data as embed } from './embed';
|
import { p2data as embed } from './embed';
|
||||||
import { p2ms } from './p2ms';
|
import { p2ms } from './p2ms';
|
||||||
import { p2pk } from './p2pk';
|
import { p2pk } from './p2pk';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
||||||
|
@ -32,7 +32,7 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment {
|
||||||
return (
|
return (
|
||||||
bscript.isCanonicalScriptSignature(<Buffer>x) ||
|
bscript.isCanonicalScriptSignature(<Buffer>x) ||
|
||||||
(opts!.allowIncomplete && <number>x === OPS.OP_0) !== undefined
|
(opts!.allowIncomplete && <number>x === OPS.OP_0) !== undefined
|
||||||
); // eslint-disable-line
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typef(
|
typef(
|
||||||
|
@ -58,8 +58,8 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment {
|
||||||
if (decoded) return;
|
if (decoded) return;
|
||||||
decoded = true;
|
decoded = true;
|
||||||
chunks = <Array<Buffer | number>>bscript.decompile(output);
|
chunks = <Array<Buffer | number>>bscript.decompile(output);
|
||||||
o.m = <number>chunks[0] - OP_INT_BASE; // eslint-disable-line
|
o.m = <number>chunks[0] - OP_INT_BASE;
|
||||||
o.n = <number>chunks[chunks.length - 2] - OP_INT_BASE; // eslint-disable-line
|
o.n = <number>chunks[chunks.length - 2] - OP_INT_BASE;
|
||||||
o.pubkeys = <Array<Buffer>>chunks.slice(1, -2);
|
o.pubkeys = <Array<Buffer>>chunks.slice(1, -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,12 +115,7 @@ export function p2ms(a: Payment, opts?: PaymentOpts): Payment {
|
||||||
if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG)
|
if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG)
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
|
|
||||||
if (
|
if (o.m! <= 0 || o.n! > 16 || o.m! > o.n! || o.n !== chunks.length - 3)
|
||||||
o.m! <= 0 || // eslint-disable-line
|
|
||||||
o.n! > 16 || // eslint-disable-line
|
|
||||||
o.m! > o.n! || // eslint-disable-line
|
|
||||||
o.n !== chunks.length - 3
|
|
||||||
)
|
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
if (!o.pubkeys!.every(x => ecc.isPoint(x)))
|
if (!o.pubkeys!.every(x => ecc.isPoint(x)))
|
||||||
throw new TypeError('Output is invalid');
|
throw new TypeError('Output is invalid');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as bcrypto from '../crypto';
|
import * as bcrypto from '../crypto';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import { bitcoin as BITCOIN_NETWORK } from '../networks'; // eslint-disable-line
|
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as bcrypto from '../crypto';
|
import * as bcrypto from '../crypto';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as bcrypto from '../crypto';
|
import * as bcrypto from '../crypto';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Payment, PaymentOpts } from './index'; // eslint-disable-line
|
import { Payment, PaymentOpts } from './index';
|
||||||
import { bitcoin as BITCOIN_NETWORK } from '../networks'; // eslint-disable-line
|
import { bitcoin as BITCOIN_NETWORK } from '../networks';
|
||||||
import * as bscript from '../script';
|
import * as bscript from '../script';
|
||||||
import * as bcrypto from '../crypto';
|
import * as bcrypto from '../crypto';
|
||||||
import * as lazy from './lazy';
|
import * as lazy from './lazy';
|
||||||
|
|
Loading…
Reference in a new issue