From 853ef18ad9544635b1c01b4d4eee9a9bdf2bef28 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 9 Aug 2017 15:32:46 -0700 Subject: [PATCH] lint: fix some linting errors. --- lib/node/config.js | 2 +- scripts/dump.js | 2 -- test/chain-test.js | 6 ++++-- test/wallet-test.js | 6 ++---- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/node/config.js b/lib/node/config.js index e25a3504..5c39749b 100644 --- a/lib/node/config.js +++ b/lib/node/config.js @@ -786,7 +786,7 @@ Config.prototype.parseConfig = function parseConfig(text) { let key = line.substring(0, index).trim(); - key = key.replace(/\-/g, '') + key = key.replace(/\-/g, ''); if (!isLowerKey(key)) throw new Error(`Invalid option on line ${num}: ${key}.`); diff --git a/scripts/dump.js b/scripts/dump.js index 64e86df3..4ebfd53a 100644 --- a/scripts/dump.js +++ b/scripts/dump.js @@ -1,10 +1,8 @@ 'use strict'; const heapdump = require('heapdump'); -const fs = require('../lib/utils/fs'); const MempoolEntry = require('../lib/mempool/mempoolentry'); const Coins = require('../lib/coins/coins'); -const TX = require('../lib/primitives/tx'); const common = require('../test/util/common'); const SNAPSHOT = `${__dirname}/../dump.heapsnapshot`; diff --git a/test/chain-test.js b/test/chain-test.js index 22df2c1c..3b298579 100644 --- a/test/chain-test.js +++ b/test/chain-test.js @@ -450,7 +450,8 @@ describe('Chain', function() { job.addTX(spend.toTX(), spend.view); job.refresh(); - assert.strictEqual(await mineBlock(job), 'mandatory-script-verify-flag-failed'); + assert.strictEqual(await mineBlock(job), + 'mandatory-script-verify-flag-failed'); }); it('should mine a block', async () => { @@ -570,7 +571,8 @@ describe('Chain', function() { block.refresh(true); block.merkleRoot = block.createMerkleRoot('hex'); - assert.strictEqual(await addBlock(block, flags), 'bad-witness-merkle-match'); + assert.strictEqual(await addBlock(block, flags), + 'bad-witness-merkle-match'); }); it('should fail to connect unexpected witness', async () => { diff --git a/test/wallet-test.js b/test/wallet-test.js index 9440d5c0..993263b7 100644 --- a/test/wallet-test.js +++ b/test/wallet-test.js @@ -52,7 +52,7 @@ function nextBlock() { return { hash: hash.toString('hex'), height: height, - prevBlock: prevHead.toString('hex'), + prevBlock: prevHash.toString('hex'), time: time, merkleRoot: encoding.NULL_HASH, nonce: 0, @@ -407,7 +407,7 @@ describe('Wallet', function() { const balance = await alice.getBalance(); assert.strictEqual(balance.unconfirmed, 11000); - let txs = await alice.getHistory(); + const txs = await alice.getHistory(); assert(txs.some((wtx) => { return wtx.hash === f1.hash('hex'); })); @@ -729,8 +729,6 @@ describe('Wallet', function() { const tx = new MTX(); tx.addOutput(carol.getAddress(), 5460); - const cost = tx.getOutputValue(); - const coins1 = await alice.getCoins(); const coins2 = await bob.getCoins();