Browse Source

Remove eslint comments.

fixTypes
junderw 6 years ago
parent
commit
0729fde36f
No known key found for this signature in database GPG Key ID: B256185D3A971908
  1. 11
      src/payments/p2ms.js
  2. 2
      src/payments/p2sh.js
  3. 2
      src/payments/p2wsh.js
  4. 2
      test/ecpair.js
  5. 2
      ts_src/payments/embed.ts
  6. 2
      ts_src/payments/index.ts
  7. 15
      ts_src/payments/p2ms.ts
  8. 2
      ts_src/payments/p2pk.ts
  9. 2
      ts_src/payments/p2pkh.ts
  10. 4
      ts_src/payments/p2sh.ts
  11. 2
      ts_src/payments/p2wpkh.ts
  12. 4
      ts_src/payments/p2wsh.ts

11
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');

2
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");

2
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");

2
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')

2
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';

2
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';

15
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(<Buffer>x) ||
(opts!.allowIncomplete && <number>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 = <Array<Buffer | number>>bscript.decompile(output);
o.m = <number>chunks[0] - OP_INT_BASE; // eslint-disable-line
o.n = <number>chunks[chunks.length - 2] - OP_INT_BASE; // eslint-disable-line
o.m = <number>chunks[0] - OP_INT_BASE;
o.n = <number>chunks[chunks.length - 2] - OP_INT_BASE;
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)
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');

2
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';

2
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';

4
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';

2
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';

4
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';

Loading…
Cancel
Save