From d2ffd2af8c5ecc94d8b2d69b6751e0235e32afd0 Mon Sep 17 00:00:00 2001 From: Alex Werner Date: Thu, 31 May 2018 19:11:03 +0200 Subject: [PATCH] V. 4.0.0 (#24) * Bump bitcore-lib to 0.15.3 * Feat : Added governance methods (deserialize, budget, votes, count,..) * Impr : Removed autoinstaller * Remove : Useless npm dependency * Impr : Use uninstall method instead of npm * Chore : bitcoind-rpc to dashd-rpc * Chore : bitcore-lib => dashcore-lib * Chore : bitcore-p2p => dashcore-p2p * Impr : Dashified + Doc * Fix : typo * Impr : More Dashifying * Impr : Even more dashifying * Fix : Old bug * Fix : Bug in logger test file * Fix : Modify regtest for new path * Impr : connect instead of spawn * typo: s/need/needs/ * Updated docs and deps * Update test for default conf integration * Update deps * Revert logger test cases * linting impr * Update npm lockfile * Added log case for dashcore.js} | 8 +- lib/cli/{bitcored.js => dashcored.js} | 8 +- lib/cli/main.js | 36 +- lib/errors.js | 6 +- lib/logger.js | 4 +- lib/node.js | 16 +- lib/scaffold/add.js | 18 +- lib/scaffold/create.js | 36 +- lib/scaffold/default-base-config.js | 8 +- lib/scaffold/default-config.js | 24 +- lib/scaffold/find-config.js | 12 +- lib/scaffold/remove.js | 41 +- lib/scaffold/start.js | 34 +- lib/service.js | 2 +- lib/services/{bitcoind.js => dashd.js} | 530 ++- lib/services/web.js | 4 +- package-lock.json | 4154 +++++++---------- package.json | 15 +- regtest/cluster.js | 38 +- regtest/{bitcoind.js => dashd.js} | 104 +- regtest/data/dash.conf | 2 +- regtest/data/node1/dash.conf | 2 +- regtest/data/node2/dash.conf | 2 +- regtest/data/node3/dash.conf | 2 +- regtest/node.js | 60 +- regtest/p2p.js | 48 +- {scripts => regtest}/regtest | 4 +- scripts/download | 121 - test/bus.integration.js | 6 +- test/data/{badbitcoin.conf => baddash.conf} | 2 +- ...ansactions.json => dash-transactions.json} | 0 test/data/{bitcoin.conf => dash.conf} | 2 +- ...default.bitcoin.conf => default.dash.conf} | 2 +- test/index.unit.js | 10 +- test/logger.unit.js | 36 +- test/node.unit.js | 8 +- test/scaffold/add.integration.js | 10 +- test/scaffold/create.integration.js | 10 +- .../default-base-config.integration.js | 10 +- test/scaffold/default-config.integration.js | 56 +- test/scaffold/find-config.integration.js | 2 +- test/scaffold/remove.integration.js | 6 +- test/scaffold/start.integration.js | 22 +- test/scaffold/start.unit.js | 10 +- .../{bitcoind.unit.js => dashd.unit.js} | 2338 +++++----- 52 files changed, 3535 insertions(+), 4493 deletions(-) delete mode 100755 bin/bitcore-node-dash create mode 100755 bin/dashcore-node rename lib/cli/{bitcore.js => dashcore.js} (86%) rename lib/cli/{bitcored.js => dashcored.js} (86%) rename lib/services/{bitcoind.js => dashd.js} (82%) rename regtest/{bitcoind.js => dashd.js} (81%) rename {scripts => regtest}/regtest (56%) delete mode 100755 scripts/download rename test/data/{badbitcoin.conf => baddash.conf} (89%) rename test/data/{bitcoin-transactions.json => dash-transactions.json} (100%) rename test/data/{bitcoin.conf => dash.conf} (95%) rename test/data/{default.bitcoin.conf => default.dash.conf} (92%) rename test/services/{bitcoind.unit.js => dashd.unit.js} (69%) diff --git a/.travis.yml b/.travis.yml index 24e29efa0..0accdbd1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ -sudo: false language: node_js +sudo: false +node_js: + - '6' + - '8' env: - CXX=g++-4.8 CC=gcc-4.8 addons: @@ -10,11 +13,8 @@ addons: - g++-4.8 - gcc-4.8 - libzmq3-dev -node_js: - - "v0.10.25" + script: - - ./scripts/download - - npm run regtest - npm run test - npm run jshint after_success: diff --git a/README.md b/README.md index 7e2227359..44f89a0c6 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,48 @@ Dashcore Node A Dash full node for building applications and services with Node.js. A node is extensible and can be configured to run additional services. At the minimum a node has an interface to [Dash Core (dashd) v0.12.1.x](https://github.com/dashpay/dash/tree/v0.12.1.x) for more advanced address queries. Additional services can be enabled to make a node more useful such as exposing new APIs, running a block explorer and wallet service. -## Install +## Usages + +### As a standalone server + +```bash +git clone https://github.com/dashevo/dashcore-node +cd dashcore-node +./bin/dashcore-node start +``` + +When running the start command, it will seek for a .dashcore folder with a dashcore-node.json conf file. +If it doesn't exist, it will create it, with basic task to connect to dashd. + +Some plugins are available : + +- Insight-API : `./bin/dashcore-node addservice @dashevo/insight-api +- Insight-UI : `./bin/dashcore-node addservice @dashevo/insight-ui` + +You also might want to add these index to your dash.conf file : +``` +-addressindex +-timestampindex +-spentindex +``` + +### As a library ```bash -npm install -g @dashevo/dashcore-node +npm install @dashevo/dashcore-node +``` + +```javascript +const dashcore = require('@dashevo/dashcore-node'); +const config = require('./dashcore-node.json'); + +let node = dashcore.scaffold.start({ path: "", config: config }); +node.on('ready', function() { + //Dash core started + dashd.on('tx', function(txData) { + let tx = new dashcore.lib.Transaction(txData); + }); +}); ``` ## Prerequisites @@ -31,7 +69,7 @@ dashcore-node start This will create a directory with configuration files for your node and install the necessary dependencies. -Please note that [Dashs v0.12.1.x](https://github.com/dashpay/dash/tree/v0.12.1.x) will be downloaded automatically. Once completed the dashd binary should be placed into the <dash-data-dir> folder specified during node creation. +Please note that [Dash Core](https://github.com/dashpay/dash/tree/master) needs to be installed first. For more information about (and developing) services, please see the [Service Documentation](docs/services.md). @@ -47,13 +85,38 @@ There are several add-on services available to extend the functionality of Bitco - [Upgrade Notes](docs/upgrade.md) - [Services](docs/services.md) - - [Bitcoind](docs/services/bitcoind.md) - Interface to Bitcoin Core + - [Dashd](docs/services/dashd.md) - Interface to Dash Core - [Web](docs/services/web.md) - Creates an express application over which services can expose their web/API content - [Development Environment](docs/development.md) - Guide for setting up a development environment - [Node](docs/node.md) - Details on the node constructor - [Bus](docs/bus.md) - Overview of the event bus constructor - [Release Process](docs/release.md) - Information about verifying a release and the release process. + +## Setting up dev environment (with Insight) + +Prerequisite : Having a dashd node already runing `dashd --daemon`. + +Dashcore-node : `git clone https://github.com/dashevo/dashcore-node -b develop` +Insight-api (optional) : `git clone https://github.com/dashevo/insight-api -b develop` +Insight-UI (optional) : `git clone https://github.com/dashevo/insight-ui -b develop` + +Install them : +``` +cd dashcore-node && npm install \ + && cd ../insight-ui && npm install \ + && cd ../insight-api && npm install && cd .. +``` + +Symbolic linking in parent folder : +``` +npm link ../insight-api +npm link ../insight-ui +``` + +Start with `./bin/dashcore-node start` to first generate a ~/.dashcore/dashcore-node.json file. +Append this file with `"@dashevo/insight-ui"` and `"@dashevo/insight-api"` in the services array. + ## Contributing Please send pull requests for bug fixes, code optimization, and ideas for improvement. For more information on how to contribute, please refer to our [CONTRIBUTING](https://github.com/dashevo/dashcore/blob/master/CONTRIBUTING.md) file. diff --git a/benchmarks/index.js b/benchmarks/index.js index 71e308640..671673c34 100644 --- a/benchmarks/index.js +++ b/benchmarks/index.js @@ -1,15 +1,15 @@ 'use strict'; var benchmark = require('benchmark'); -var bitcoin = require('bitcoin'); +var dashdRPC = require('@dashevo/dashd-rpc'); var async = require('async'); var maxTime = 20; -console.log('Bitcoin Service native interface vs. Bitcoin JSON RPC interface'); +console.log('Dash Service native interface vs. Dash JSON RPC interface'); console.log('----------------------------------------------------------------------'); -// To run the benchmarks a fully synced Bitcore Core directory is needed. The RPC comands -// can be modified to match the settings in bitcoin.conf. +// To run the benchmarks a fully synced Dash Core directory is needed. The RPC comands +// can be modified to match the settings in dash.conf. var fixtureData = { blockHashes: [ @@ -26,34 +26,34 @@ var fixtureData = { ] }; -var bitcoind = require('../').services.Bitcoin({ +var dashd = require('../').services.Dash({ node: { - datadir: process.env.HOME + '/.bitcoin', + datadir: process.env.HOME + '/.dash', network: { name: 'testnet' } } }); -bitcoind.on('error', function(err) { +dashd.on('error', function(err) { console.error(err.message); }); -bitcoind.start(function(err) { +dashd.start(function(err) { if (err) { throw err; } - console.log('Bitcoin Core started'); + console.log('Dash Core started'); }); -bitcoind.on('ready', function() { +dashd.on('ready', function() { - console.log('Bitcoin Core ready'); + console.log('Dash Core ready'); - var client = new bitcoin.Client({ + var client = new dashdRPC({ host: 'localhost', port: 18332, - user: 'bitcoin', + user: 'dash', pass: 'local321' }); @@ -64,12 +64,12 @@ bitcoind.on('ready', function() { var hashesLength = fixtureData.blockHashes.length; var txLength = fixtureData.txHashes.length; - function bitcoindGetBlockNative(deffered) { + function dashdGetBlockNative(deffered) { if (c >= hashesLength) { c = 0; } var hash = fixtureData.blockHashes[c]; - bitcoind.getBlock(hash, function(err, block) { + dashd.getBlock(hash, function(err, block) { if (err) { throw err; } @@ -78,7 +78,7 @@ bitcoind.on('ready', function() { c++; } - function bitcoindGetBlockJsonRpc(deffered) { + function dashdGetBlockJsonRpc(deffered) { if (c >= hashesLength) { c = 0; } @@ -92,12 +92,12 @@ bitcoind.on('ready', function() { c++; } - function bitcoinGetTransactionNative(deffered) { + function dashGetTransactionNative(deffered) { if (c >= txLength) { c = 0; } var hash = fixtureData.txHashes[c]; - bitcoind.getTransaction(hash, true, function(err, tx) { + dashd.getTransaction(hash, true, function(err, tx) { if (err) { throw err; } @@ -106,7 +106,7 @@ bitcoind.on('ready', function() { c++; } - function bitcoinGetTransactionJsonRpc(deffered) { + function dashGetTransactionJsonRpc(deffered) { if (c >= txLength) { c = 0; } @@ -122,22 +122,22 @@ bitcoind.on('ready', function() { var suite = new benchmark.Suite(); - suite.add('bitcoind getblock (native)', bitcoindGetBlockNative, { + suite.add('dashd getblock (native)', dashdGetBlockNative, { defer: true, maxTime: maxTime }); - suite.add('bitcoind getblock (json rpc)', bitcoindGetBlockJsonRpc, { + suite.add('dashd getblock (json rpc)', dashdGetBlockJsonRpc, { defer: true, maxTime: maxTime }); - suite.add('bitcoind gettransaction (native)', bitcoinGetTransactionNative, { + suite.add('dashd gettransaction (native)', dashGetTransactionNative, { defer: true, maxTime: maxTime }); - suite.add('bitcoind gettransaction (json rpc)', bitcoinGetTransactionJsonRpc, { + suite.add('dashd gettransaction (json rpc)', dashGetTransactionJsonRpc, { defer: true, maxTime: maxTime }); @@ -158,7 +158,7 @@ bitcoind.on('ready', function() { throw err; } console.log('Finished'); - bitcoind.stop(function(err) { + dashd.stop(function(err) { if (err) { console.error('Fail to stop services: ' + err); process.exit(1); diff --git a/bin/bitcore-node-dash b/bin/bitcore-node-dash deleted file mode 100755 index 96291d286..000000000 --- a/bin/bitcore-node-dash +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node - -var bitcore = require('../lib/cli/bitcore'); -bitcore(); diff --git a/bin/dashcore-node b/bin/dashcore-node new file mode 100755 index 000000000..d96799260 --- /dev/null +++ b/bin/dashcore-node @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +var dashcore = require('../lib/cli/dashcore'); +dashcore(); diff --git a/index.js b/index.js index fd459ac04..6370f5bf4 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ module.exports.Service = require('./lib/service'); module.exports.errors = require('./lib/errors'); module.exports.services = {}; -module.exports.services.Bitcoin = require('./lib/services/bitcoind'); +module.exports.services.Dash = require('./lib/services/dashd'); module.exports.services.Web = require('./lib/services/web'); module.exports.scaffold = {}; @@ -21,7 +21,7 @@ module.exports.scaffold.defaultConfig = require('./lib/scaffold/default-config') module.exports.cli = {}; module.exports.cli.main = require('./lib/cli/main'); module.exports.cli.daemon = require('./lib/cli/daemon'); -module.exports.cli.bitcore = require('./lib/cli/bitcore'); -module.exports.cli.bitcored = require('./lib/cli/bitcored'); +module.exports.cli.dashcore = require('./lib/cli/dashcore'); +module.exports.cli.dashcored = require('./lib/cli/dashcored'); -module.exports.lib = require('bitcore-lib-dash'); +module.exports.lib = require('@dashevo/dashcore-lib'); diff --git a/lib/cli/daemon.js b/lib/cli/daemon.js index 959b3135c..2cc89ada7 100644 --- a/lib/cli/daemon.js +++ b/lib/cli/daemon.js @@ -2,21 +2,21 @@ var program = require('commander'); var path = require('path'); -var bitcore = require('..'); +var dashcore = require('..'); function main(servicesPath, additionalServices) { /* jshint maxstatements: 100 */ - var version = bitcore.version; - var start = bitcore.scaffold.start; - var findConfig = bitcore.scaffold.findConfig; - var defaultConfig = bitcore.scaffold.defaultConfig; + var version = dashcore.version; + var start = dashcore.scaffold.start; + var findConfig = dashcore.scaffold.findConfig; + var defaultConfig = dashcore.scaffold.defaultConfig; program .version(version) .description('Start the current node') - .option('-c, --config ', 'Specify the directory with Bitcore Node configuration') - .option('-d, --daemon', 'Make bitcore a daemon (running in the background)'); + .option('-c, --config ', 'Specify the directory with Dashcore Node configuration') + .option('-d, --daemon', 'Make dashcore a daemon (running in the background)'); program.parse(process.argv); diff --git a/lib/cli/bitcore.js b/lib/cli/dashcore.js similarity index 86% rename from lib/cli/bitcore.js rename to lib/cli/dashcore.js index 796debc66..6e99a1b1c 100644 --- a/lib/cli/bitcore.js +++ b/lib/cli/dashcore.js @@ -5,10 +5,10 @@ var Liftoff = require('liftoff'); function main(parentServicesPath, additionalServices) { var liftoff = new Liftoff({ - name: 'bitcore', - moduleName: 'bitcore-node-dash', - configName: 'bitcore-node-dash', - processTitle: 'bitcore' + name: 'dashcore', + moduleName: 'dashcore-node', + configName: 'dashcore-node', + processTitle: 'dashcore' }).on('require', function (name) { console.log('Loading:', name); }).on('requireFail', function (name, err) { diff --git a/lib/cli/bitcored.js b/lib/cli/dashcored.js similarity index 86% rename from lib/cli/bitcored.js rename to lib/cli/dashcored.js index 3671c68af..243263e97 100644 --- a/lib/cli/bitcored.js +++ b/lib/cli/dashcored.js @@ -5,10 +5,10 @@ var Liftoff = require('liftoff'); function main(parentServicesPath, additionalServices) { var liftoff = new Liftoff({ - name: 'bitcored', - moduleName: 'bitcore-node-dash', - configName: 'bitcore-node-dash', - processTitle: 'bitcored' + name: 'dashcored', + moduleName: 'dashcore-node', + configName: 'dashcore-node', + processTitle: 'dashcored' }).on('require', function (name) { console.log('Loading:', name); }).on('requireFail', function (name, err) { diff --git a/lib/cli/main.js b/lib/cli/main.js index ad3788b22..efe304770 100644 --- a/lib/cli/main.js +++ b/lib/cli/main.js @@ -2,20 +2,20 @@ var program = require('commander'); var path = require('path'); -var bitcorenode = require('..'); +var dashcorenode = require('..'); var utils = require('../utils'); function main(servicesPath, additionalServices) { /* jshint maxstatements: 100 */ - var version = bitcorenode.version; - var create = bitcorenode.scaffold.create; - var add = bitcorenode.scaffold.add; - var start = bitcorenode.scaffold.start; - var remove = bitcorenode.scaffold.remove; - var callMethod = bitcorenode.scaffold.callMethod; - var findConfig = bitcorenode.scaffold.findConfig; - var defaultConfig = bitcorenode.scaffold.defaultConfig; + var version = dashcorenode.version; + var create = dashcorenode.scaffold.create; + var add = dashcorenode.scaffold.add; + var start = dashcorenode.scaffold.start; + var remove = dashcorenode.scaffold.remove; + var callMethod = dashcorenode.scaffold.callMethod; + var findConfig = dashcorenode.scaffold.findConfig; + var defaultConfig = dashcorenode.scaffold.defaultConfig; program .version(version); @@ -23,7 +23,7 @@ function main(servicesPath, additionalServices) { program .command('create ') .description('Create a new node') - .option('-d, --datadir ', 'Specify the bitcoin database directory') + .option('-d, --datadir ', 'Specify the Dash database directory') .option('-t, --testnet', 'Enable testnet as the network') .action(function(dirname, cmd){ if (cmd.datadir) { @@ -49,8 +49,8 @@ function main(servicesPath, additionalServices) { program .command('start') .description('Start the current node') - .option('-c, --config ', 'Specify the directory with Bitcore Node configuration') - .option('-d, --daemon', 'Make bitcore-node-dash a daemon (running in the background)') + .option('-c, --config ', 'Specify the directory with Dashcore Node configuration') + .option('-d, --daemon', 'Make dashcore-node a daemon (running in the background)') .action(function(cmd){ if (cmd.config) { cmd.config = path.resolve(process.cwd(), cmd.config); @@ -76,7 +76,7 @@ function main(servicesPath, additionalServices) { .action(function(services){ var configInfo = findConfig(process.cwd()); if (!configInfo) { - throw new Error('Could not find configuration, see `bitcore-node-dash create --help`'); + throw new Error('Could not find configuration, see `dashcore-node create --help`'); } var opts = { path: configInfo.path, @@ -91,8 +91,8 @@ function main(servicesPath, additionalServices) { }).on('--help', function() { console.log(' Examples:'); console.log(); - console.log(' $ bitcore-node-dash add wallet-service'); - console.log(' $ bitcore-node-dash add insight-api'); + console.log(' $ dashcore-node add wallet-service'); + console.log(' $ dashcore-node add insight-api'); console.log(); }); @@ -102,7 +102,7 @@ function main(servicesPath, additionalServices) { .action(function(services){ var configInfo = findConfig(process.cwd()); if (!configInfo) { - throw new Error('Could not find configuration, see `bitcore-node-dash create --help`'); + throw new Error('Could not find configuration, see `dashcore-node create --help`'); } var opts = { path: configInfo.path, @@ -117,8 +117,8 @@ function main(servicesPath, additionalServices) { }).on('--help', function() { console.log(' Examples:'); console.log(); - console.log(' $ bitcore-node-dash remove wallet-service'); - console.log(' $ bitcore-node-dash remove insight-api'); + console.log(' $ dashcore-node remove wallet-service'); + console.log(' $ dashcore-node remove insight-api'); console.log(); }); diff --git a/lib/errors.js b/lib/errors.js index c534d0a24..f42702fe9 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -2,11 +2,11 @@ var createError = require('errno').create; -var BitcoreNodeError = createError('BitcoreNodeError'); +var DashcoreNodeError = createError('DashcoreNodeError'); -var RPCError = createError('RPCError', BitcoreNodeError); +var RPCError = createError('RPCError', DashcoreNodeError); module.exports = { - Error: BitcoreNodeError, + Error: DashcoreNodeError, RPCError: RPCError }; diff --git a/lib/logger.js b/lib/logger.js index 0d0b78f67..3434adfa0 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,7 +1,7 @@ 'use strict'; -var bitcore = require('bitcore-lib-dash'); -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var _ = dashcore.deps._; var colors = require('colors/safe'); /** diff --git a/lib/node.js b/lib/node.js index 578bcd5a3..0bee9966b 100644 --- a/lib/node.js +++ b/lib/node.js @@ -3,10 +3,10 @@ var util = require('util'); var EventEmitter = require('events').EventEmitter; var async = require('async'); -var bitcore = require('bitcore-lib-dash'); -var Networks = bitcore.Networks; -var $ = bitcore.util.preconditions; -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var Networks = dashcore.Networks; +var $ = dashcore.util.preconditions; +var _ = dashcore.deps._; var index = require('./'); var log = index.log; var Bus = require('./bus'); @@ -20,7 +20,7 @@ var errors = require('./errors'); * The array of services should have the format: * ```js * { - * name: 'bitcoind', + * name: 'dashd', * config: {}, // options to pass into constructor * module: ServiceConstructor * } @@ -183,7 +183,7 @@ Node.prototype.getServiceOrder = function() { Node.prototype._startService = function(serviceInfo, callback) { var self = this; - log.info('Starting ' + serviceInfo.name); // TODO: update service name in bitcore-node-dash.json + log.info('Starting ' + serviceInfo.name); // TODO: update service name in dashcore-node.json var config; if (serviceInfo.config) { @@ -294,10 +294,10 @@ Node.prototype.stop = function(callback) { services, function(service, next) { if (self.services[service.name]) { - log.info('Stopping ' + service.name); // TODO: update service name in bitcore-node-dash.json + log.info('Stopping ' + service.name); // TODO: update service name in dashcore-node.json self.services[service.name].stop(next); } else { - log.info('Stopping ' + service.name + ' (not started)'); // TODO: update service name in bitcore-node-dash.json + log.info('Stopping ' + service.name + ' (not started)'); // TODO: update service name in dashcore-node.json setImmediate(next); } }, diff --git a/lib/scaffold/add.js b/lib/scaffold/add.js index 883c732e6..fd8473913 100644 --- a/lib/scaffold/add.js +++ b/lib/scaffold/add.js @@ -4,10 +4,10 @@ var async = require('async'); var fs = require('fs'); var path = require('path'); var spawn = require('child_process').spawn; -var bitcore = require('bitcore-lib-dash'); +var dashcore = require('@dashevo/dashcore-lib'); var utils = require('../utils'); -var $ = bitcore.util.preconditions; -var _ = bitcore.deps._; +var $ = dashcore.util.preconditions; +var _ = dashcore.deps._; /** * @param {String} configFilePath - The absolute path to the configuration file @@ -62,7 +62,7 @@ function addService(configDir, service, done) { /** * @param {String} options.cwd - The current working directory - * @param {String} options.dirname - The bitcore-node-dash configuration directory + * @param {String} options.dirname - The dashcore-node configuration directory * @param {Array} options.services - An array of strings of service names * @param {Function} done - A callback function called when finished */ @@ -78,12 +78,12 @@ function add(options, done) { var configPath = options.path; var services = options.services; - var bitcoreConfigPath = path.resolve(configPath, 'bitcore-node-dash.json'); + var dashcoreConfigPath = path.resolve(configPath, 'dashcore-node.json'); var packagePath = path.resolve(configPath, 'package.json'); - if (!fs.existsSync(bitcoreConfigPath) || !fs.existsSync(packagePath)) { + if (!fs.existsSync(dashcoreConfigPath) || !fs.existsSync(packagePath)) { return done( - new Error('Directory does not have a bitcore-node-dash.json and/or package.json file.') + new Error('Directory does not have a dashcore-node.json and/or package.json file.') ); } @@ -108,8 +108,8 @@ function add(options, done) { oldPackage = updatedPackage; var serviceName = newDependencies[0]; - // add service to bitcore-node-dash.json - addConfig(bitcoreConfigPath, serviceName, next); + // add service to dashcore-node.json + addConfig(dashcoreConfigPath, serviceName, next); }); }, done ); diff --git a/lib/scaffold/create.js b/lib/scaffold/create.js index 16cba8764..9a5734219 100644 --- a/lib/scaffold/create.js +++ b/lib/scaffold/create.js @@ -1,10 +1,10 @@ 'use strict'; var spawn = require('child_process').spawn; -var bitcore = require('bitcore-lib-dash'); +var dashcore = require('@dashevo/dashcore-lib'); var async = require('async'); -var $ = bitcore.util.preconditions; -var _ = bitcore.deps._; +var $ = dashcore.util.preconditions; +var _ = dashcore.deps._; var path = require('path'); var packageFile = require('../../package.json'); var mkdirp = require('mkdirp'); @@ -14,22 +14,22 @@ var defaultBaseConfig = require('./default-base-config'); var version = '^' + packageFile.version; var BASE_PACKAGE = { - description: 'A full Bitcoin node build with Bitcore', + description: 'A full Dash node build with Dashcore', repository: 'https://github.com/user/project', license: 'MIT', readme: 'README.md', dependencies: { - 'bitcore-lib-dash': '^' + bitcore.version, - 'bitcore-node-dash': version + '@dashevo/dashcore-lib': '^' + dashcore.version, + '@dashevo/dashcore-node': version } }; /** - * Will create a directory and bitcoin.conf file for Bitcoin. + * Will create a directory and dash.conf file for Dash. * @param {String} dataDir - The absolute path * @param {Function} done - The callback function called when finished */ -function createBitcoinDirectory(datadir, done) { +function createDashDirectory(datadir, done) { mkdirp(datadir, function(err) { if (err) { throw err; @@ -42,10 +42,10 @@ function createBitcoinDirectory(datadir, done) { } /** - * Will create a base Bitcore Node configuration directory and files. + * Will create a base Dashcore Node configuration directory and files. * @param {Object} options * @param {String} options.network - "testnet" or "livenet" - * @param {String} options.datadir - The bitcoin database directory + * @param {String} options.datadir - The dash database directory * @param {String} configDir - The absolute path * @param {Boolean} isGlobal - If the configuration depends on globally installed node services. * @param {Function} done - The callback function called when finished @@ -61,7 +61,7 @@ function createConfigDirectory(options, configDir, isGlobal, done) { var configJSON = JSON.stringify(config, null, 2); var packageJSON = JSON.stringify(BASE_PACKAGE, null, 2); try { - fs.writeFileSync(configDir + '/bitcore-node-dash.json', configJSON); + fs.writeFileSync(configDir + '/dashcore-node.json', configJSON); if (!isGlobal) { fs.writeFileSync(configDir + '/package.json', packageJSON); } @@ -74,13 +74,13 @@ function createConfigDirectory(options, configDir, isGlobal, done) { } /** - * Will setup a directory with a Bitcore Node directory, configuration file, - * bitcoin configuration, and will install all necessary dependencies. + * Will setup a directory with a Dashcore Node directory, configuration file, + * dash configuration, and will install all necessary dependencies. * * @param {Object} options * @param {String} options.cwd - The current working directory - * @param {String} options.dirname - The name of the bitcore node configuration directory - * @param {String} options.datadir - The path to the bitcoin datadir + * @param {String} options.dirname - The name of the dashcore node configuration directory + * @param {String} options.datadir - The path to the dash datadir * @param {Function} done - A callback function called when finished */ function create(options, done) { @@ -103,7 +103,7 @@ function create(options, done) { async.series([ function(next) { - // Setup the the bitcore-node-dash directory and configuration + // Setup the the dashcore-node directory and configuration if (!fs.existsSync(absConfigDir)) { var createOptions = { network: options.network, @@ -115,9 +115,9 @@ function create(options, done) { } }, function(next) { - // Setup the bitcoin directory and configuration + // Setup the Dash directory and configuration if (!fs.existsSync(absDataDir)) { - createBitcoinDirectory(absDataDir, next); + createDashDirectory(absDataDir, next); } else { next(); } diff --git a/lib/scaffold/default-base-config.js b/lib/scaffold/default-base-config.js index 37fced3c9..96004e38c 100644 --- a/lib/scaffold/default-base-config.js +++ b/lib/scaffold/default-base-config.js @@ -3,11 +3,11 @@ var path = require('path'); /** - * Will return the path and default bitcore-node-dash configuration on environment variables + * Will return the path and default dashcore-node configuration on environment variables * or default locations. * @param {Object} options * @param {String} options.network - "testnet" or "livenet" - * @param {String} options.datadir - Absolute path to bitcoin database directory + * @param {String} options.datadir - Absolute path to Dash database directory */ function getDefaultBaseConfig(options) { if (!options) { @@ -21,9 +21,9 @@ function getDefaultBaseConfig(options) { config: { network: options.network || 'livenet', port: 3001, - services: ['bitcoind', 'web'], + services: ['dashd', 'web'], servicesConfig: { - bitcoind: { + dashd: { spawn: { datadir: datadir, exec: path.resolve(__dirname, datadir, 'dashd') diff --git a/lib/scaffold/default-config.js b/lib/scaffold/default-config.js index 7241f5e98..2ce6f1147 100644 --- a/lib/scaffold/default-config.js +++ b/lib/scaffold/default-config.js @@ -5,8 +5,8 @@ var mkdirp = require('mkdirp'); var fs = require('fs'); /** - * Will return the path and default bitcore-node-dash configuration. It will search for the - * configuration file in the "~/.bitcore" directory, and if it doesn't exist, it will create one + * Will return the path and default dashcore-node configuration. It will search for the + * configuration file in the "~/.dashcore" directory, and if it doesn't exist, it will create one * based on default settings. * @param {Object} [options] * @param {Array} [options.additionalServices] - An optional array of services. @@ -17,29 +17,33 @@ function getDefaultConfig(options) { options = {}; } - var defaultPath = path.resolve(process.env.HOME, './.bitcore'); - var defaultConfigFile = path.resolve(defaultPath, './bitcore-node-dash.json'); + var defaultPath = path.resolve(process.env.HOME, './.dashcore'); + var defaultConfigFile = path.resolve(defaultPath, './dashcore-node.json'); if (!fs.existsSync(defaultPath)) { mkdirp.sync(defaultPath); } - var defaultServices = ['bitcoind', 'web']; + var defaultServices = ['dashd', 'web']; if (options.additionalServices) { defaultServices = defaultServices.concat(options.additionalServices); } if (!fs.existsSync(defaultConfigFile)) { + var defaultConfig = { network: 'livenet', port: 3001, services: defaultServices, servicesConfig: { - bitcoind: { - spawn: { - datadir: path.resolve(defaultPath, './data'), - exec: path.resolve(__dirname, defaultPath, './data/dashd') - } + dashd: { + connect: [{ + rpchost: '127.0.0.1', + rpcport: 9998, + rpcuser: 'dash', + rpcpassword: 'local321', + zmqpubrawtx: 'tcp://127.0.0.1:28332' + }] } } }; diff --git a/lib/scaffold/find-config.js b/lib/scaffold/find-config.js index 8c10e677b..352f9aa46 100644 --- a/lib/scaffold/find-config.js +++ b/lib/scaffold/find-config.js @@ -1,21 +1,21 @@ 'use strict'; -var bitcore = require('bitcore-lib-dash'); -var $ = bitcore.util.preconditions; -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var $ = dashcore.util.preconditions; +var _ = dashcore.deps._; var path = require('path'); var fs = require('fs'); var utils = require('../utils'); /** - * Will return the path and bitcore-node-dash configuration + * Will return the path and dashcore-node configuration * @param {String} cwd - The absolute path to the current working directory */ function findConfig(cwd) { $.checkArgument(_.isString(cwd), 'Argument should be a string'); $.checkArgument(utils.isAbsolutePath(cwd), 'Argument should be an absolute path'); var directory = String(cwd); - while (!fs.existsSync(path.resolve(directory, 'bitcore-node-dash.json'))) { + while (!fs.existsSync(path.resolve(directory, 'dashcore-node.json'))) { directory = path.resolve(directory, '../'); if (directory === '/') { return false; @@ -23,7 +23,7 @@ function findConfig(cwd) { } return { path: directory, - config: require(path.resolve(directory, 'bitcore-node-dash.json')) + config: require(path.resolve(directory, 'dashcore-node.json')) }; } diff --git a/lib/scaffold/remove.js b/lib/scaffold/remove.js index 11bf4aac9..a872e7a81 100644 --- a/lib/scaffold/remove.js +++ b/lib/scaffold/remove.js @@ -2,16 +2,15 @@ var async = require('async'); var fs = require('fs'); -var npm = require('npm'); var path = require('path'); var spawn = require('child_process').spawn; -var bitcore = require('bitcore-lib-dash'); -var $ = bitcore.util.preconditions; -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var $ = dashcore.util.preconditions; +var _ = dashcore.deps._; var utils = require('../utils'); /** - * Will remove a service from bitcore-node-dash.json + * Will remove a service from dashcore-node.json * @param {String} configFilePath - The absolute path to the configuration file * @param {String} service - The name of the module * @param {Function} done @@ -80,29 +79,15 @@ function removeService(configDir, service, done) { $.checkArgument(utils.isAbsolutePath(configDir), 'An absolute path is expected'); $.checkArgument(_.isString(service), 'A string is expected for the service argument'); - // check if the service is installed - npm.load(function(err) { - if (err) { - return done(err); - } - npm.commands.ls([service], true /*silent*/, function(err, data, lite) { - if (err) { - return done(err); - } - if (lite.dependencies) { - uninstallService(configDir, service, done); - } else { - done(); - } - }); - }); + uninstallService(configDir, service, done); + } /** - * Will remove the Node.js service and from the bitcore-node-dash configuration. + * Will remove the Node.js service and from the dashcore-node configuration. * @param {String} options.cwd - The current working directory - * @param {String} options.dirname - The bitcore-node-dash configuration directory + * @param {String} options.dirname - The dashcore-node configuration directory * @param {Array} options.services - An array of strings of service names * @param {Function} done - A callback function called when finished */ @@ -118,12 +103,12 @@ function remove(options, done) { var configPath = options.path; var services = options.services; - var bitcoreConfigPath = path.resolve(configPath, 'bitcore-node-dash.json'); + var dashcoreConfigPath = path.resolve(configPath, 'dashcore-node.json'); var packagePath = path.resolve(configPath, 'package.json'); - if (!fs.existsSync(bitcoreConfigPath) || !fs.existsSync(packagePath)) { + if (!fs.existsSync(dashcoreConfigPath) || !fs.existsSync(packagePath)) { return done( - new Error('Directory does not have a bitcore-node-dash.json and/or package.json file.') + new Error('Directory does not have a dashcore-node.json and/or package.json file.') ); } @@ -135,8 +120,8 @@ function remove(options, done) { if (err) { return next(err); } - // remove service to bitcore-node-dash.json - removeConfig(bitcoreConfigPath, service, next); + // remove service to dashcore-node.json + removeConfig(dashcoreConfigPath, service, next); }); }, done ); diff --git a/lib/scaffold/start.js b/lib/scaffold/start.js index 6f31afde6..9ac4bd144 100644 --- a/lib/scaffold/start.js +++ b/lib/scaffold/start.js @@ -1,10 +1,10 @@ 'use strict'; var path = require('path'); -var BitcoreNode = require('../node'); +var DashcoreNode = require('../node'); var index = require('../'); -var bitcore = require('bitcore-lib-dash'); -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var _ = dashcore.deps._; var log = index.log; var shuttingDown = false; @@ -22,16 +22,16 @@ function checkConfigVersion2(fullConfig) { if (!datadirUndefined || addressDefined || dbDefined) { console.warn('\nConfiguration file is not compatible with this version. \n' + - 'A reindex for bitcoind is necessary for this upgrade with the "reindex=1" bitcoin.conf option. \n' + - 'There are changes necessary in both bitcoin.conf and bitcore-node-dash.json. \n\n' + + 'A reindex for dashd is necessary for this upgrade with the "reindex=1" dash.conf option. \n' + + 'There are changes necessary in both dash.conf and dashcore-node.json. \n\n' + 'To upgrade please see the details below and documentation at: \n' + - 'https://github.com/bitpay/bitcore-node-dash/blob/bitcoind/docs/upgrade.md \n'); + 'https://github.com/dashevo/dashcore-node/blob/dashd/docs/upgrade.md \n'); if (!datadirUndefined) { console.warn('Please remove "datadir" and add it to the config at ' + fullConfig.path + ' with:'); var missingConfig = { servicesConfig: { - bitcoind: { + dashd: { spawn: { datadir: fullConfig.datadir, exec: path.resolve(__dirname, '../../bin/dashd') @@ -58,7 +58,7 @@ function checkConfigVersion2(fullConfig) { * @param {Object} options * @param {Object} options.servicesPath - The path to the location of service modules * @param {String} options.path - The absolute path of the configuration file - * @param {Object} options.config - The parsed bitcore-node-dash.json configuration file + * @param {Object} options.config - The parsed dashcore-node.json configuration file * @param {Array} options.config.services - An array of services names. * @param {Object} options.config.servicesConfig - Parameters to pass to each service * @param {String} options.config.network - 'livenet', 'testnet' or 'regtest @@ -76,7 +76,7 @@ function start(options) { servicesPath = options.path; // defaults to the same directory } - fullConfig.path = path.resolve(options.path, './bitcore-node-dash.json'); + fullConfig.path = path.resolve(options.path, './dashcore-node.json'); if (checkConfigVersion2(fullConfig)) { process.exit(1); @@ -84,13 +84,13 @@ function start(options) { fullConfig.services = start.setupServices(require, servicesPath, options.config); - var node = new BitcoreNode(fullConfig); + var node = new DashcoreNode(fullConfig); // setup handlers for uncaught exceptions and ctrl+c start.registerExitHandlers(process, node); node.on('ready', function() { - log.info('Bitcore Node ready'); + log.info('Dashcore Node ready'); }); node.on('error', function(err) { @@ -135,15 +135,15 @@ function checkService(service) { */ function loadModule(req, service) { try { - // first try in the built-in bitcore-node-dash services directory + // first try in the built-in dashcore-node services directory service.module = req(path.resolve(__dirname, '../services/' + service.name)); } catch(e) { // check if the package.json specifies a specific file to use var servicePackage = req(service.name + '/package.json'); var serviceModule = service.name; - if (servicePackage.bitcoreNode) { - serviceModule = service.name + '/' + servicePackage.bitcoreNode; + if (servicePackage.dashcoreNode) { + serviceModule = service.name + '/' + servicePackage.dashcoreNode; } service.module = req(serviceModule); } @@ -154,9 +154,9 @@ function loadModule(req, service) { * specified modules, and assemble an array in this format: * [ * { - * name: 'bitcoind', + * name: 'dashd', * config: {}, - * module: BitcoinService + * module: DashService * } * ] * @param {Function} req - The require function to use @@ -190,7 +190,7 @@ function setupServices(req, servicesPath, config) { /** * Will shutdown a node and then the process * @param {Object} _process - The Node.js process object - * @param {Node} node - The Bitcore Node instance + * @param {Node} node - The Dashcore Node instance */ function cleanShutdown(_process, node) { node.stop(function(err) { diff --git a/lib/service.js b/lib/service.js index 17243ebca..cb3133fea 100644 --- a/lib/service.js +++ b/lib/service.js @@ -68,7 +68,7 @@ Service.prototype.start = function(done) { }; /** - * Function to be called when bitcore-node-dash is stopped + * Function to be called when dashcore-node is stopped */ Service.prototype.stop = function(done) { setImmediate(done); diff --git a/lib/services/bitcoind.js b/lib/services/dashd.js similarity index 82% rename from lib/services/bitcoind.js rename to lib/services/dashd.js index d562528a5..d65f37550 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/dashd.js @@ -5,15 +5,15 @@ var path = require('path'); var spawn = require('child_process').spawn; var util = require('util'); var mkdirp = require('mkdirp'); -var bitcore = require('bitcore-lib-dash'); +var dashcore = require('@dashevo/dashcore-lib'); var zmq = require('zmq'); var async = require('async'); var LRU = require('lru-cache'); -var BitcoinRPC = require('bitcoind-rpc-dash'); -var $ = bitcore.util.preconditions; -var _ = bitcore.deps._; -var Transaction = bitcore.Transaction; -var Proposal = bitcore.GovObject.Proposal; +var DashdRPC = require('@dashevo/dashd-rpc'); +var $ = dashcore.util.preconditions; +var _ = dashcore.deps._; +var Transaction = dashcore.Transaction; +var Proposal = dashcore.GovObject.Proposal; var index = require('../'); var errors = index.errors; @@ -30,9 +30,9 @@ var Service = require('../service'); * @param {Object} options * @param {Node} options.node - A reference to the node */ -function Bitcoin(options) { - if (!(this instanceof Bitcoin)) { - return new Bitcoin(options); +function Dash(options) { + if (!(this instanceof Dash)) { + return new Dash(options); } Service.call(this, options); @@ -40,7 +40,7 @@ function Bitcoin(options) { this._initCaches(); - // bitcoind child process + // dashd child process this.spawn = false; // event subscribers @@ -63,24 +63,24 @@ function Bitcoin(options) { log.error(err.stack); }); } -util.inherits(Bitcoin, Service); - -Bitcoin.dependencies = []; - -Bitcoin.DEFAULT_MAX_TXIDS = 1000; -Bitcoin.DEFAULT_MAX_HISTORY = 50; -Bitcoin.DEFAULT_SHUTDOWN_TIMEOUT = 15000; -Bitcoin.DEFAULT_ZMQ_SUBSCRIBE_PROGRESS = 0.9999; -Bitcoin.DEFAULT_MAX_ADDRESSES_QUERY = 10000; -Bitcoin.DEFAULT_SPAWN_RESTART_TIME = 5000; -Bitcoin.DEFAULT_SPAWN_STOP_TIME = 10000; -Bitcoin.DEFAULT_TRY_ALL_INTERVAL = 1000; -Bitcoin.DEFAULT_REINDEX_INTERVAL = 10000; -Bitcoin.DEFAULT_START_RETRY_INTERVAL = 5000; -Bitcoin.DEFAULT_TIP_UPDATE_INTERVAL = 15000; -Bitcoin.DEFAULT_TRANSACTION_CONCURRENCY = 5; -Bitcoin.DEFAULT_INSTANTSEND_FEE = 10000; -Bitcoin.DEFAULT_CONFIG_SETTINGS = { +util.inherits(Dash, Service); + +Dash.dependencies = []; + +Dash.DEFAULT_MAX_TXIDS = 1000; +Dash.DEFAULT_MAX_HISTORY = 50; +Dash.DEFAULT_SHUTDOWN_TIMEOUT = 15000; +Dash.DEFAULT_ZMQ_SUBSCRIBE_PROGRESS = 0.9999; +Dash.DEFAULT_MAX_ADDRESSES_QUERY = 10000; +Dash.DEFAULT_SPAWN_RESTART_TIME = 5000; +Dash.DEFAULT_SPAWN_STOP_TIME = 10000; +Dash.DEFAULT_TRY_ALL_INTERVAL = 1000; +Dash.DEFAULT_REINDEX_INTERVAL = 10000; +Dash.DEFAULT_START_RETRY_INTERVAL = 5000; +Dash.DEFAULT_TIP_UPDATE_INTERVAL = 15000; +Dash.DEFAULT_TRANSACTION_CONCURRENCY = 5; +Dash.DEFAULT_INSTANTSEND_FEE = 10000; +Dash.DEFAULT_CONFIG_SETTINGS = { server: 1, whitelist: '127.0.0.1', txindex: 1, @@ -93,58 +93,69 @@ Bitcoin.DEFAULT_CONFIG_SETTINGS = { rpcallowip: '127.0.0.1', rpcuser: 'dash', rpcpassword: 'local321', - uacomment: 'bitcore' + uacomment: 'dashcore' }; -Bitcoin.prototype._initDefaults = function(options) { +Dash.prototype._initDefaults = function(options) { /* jshint maxcomplexity: 15 */ // limits - this.maxTxids = options.maxTxids || Bitcoin.DEFAULT_MAX_TXIDS; - this.maxTransactionHistory = options.maxTransactionHistory || Bitcoin.DEFAULT_MAX_HISTORY; - this.maxAddressesQuery = options.maxAddressesQuery || Bitcoin.DEFAULT_MAX_ADDRESSES_QUERY; - this.shutdownTimeout = options.shutdownTimeout || Bitcoin.DEFAULT_SHUTDOWN_TIMEOUT; + this.maxTxids = options.maxTxids || Dash.DEFAULT_MAX_TXIDS; + this.maxTransactionHistory = options.maxTransactionHistory || Dash.DEFAULT_MAX_HISTORY; + this.maxAddressesQuery = options.maxAddressesQuery || Dash.DEFAULT_MAX_ADDRESSES_QUERY; + this.shutdownTimeout = options.shutdownTimeout || Dash.DEFAULT_SHUTDOWN_TIMEOUT; // spawn restart setting - this.spawnRestartTime = options.spawnRestartTime || Bitcoin.DEFAULT_SPAWN_RESTART_TIME; - this.spawnStopTime = options.spawnStopTime || Bitcoin.DEFAULT_SPAWN_STOP_TIME; + this.spawnRestartTime = options.spawnRestartTime || Dash.DEFAULT_SPAWN_RESTART_TIME; + this.spawnStopTime = options.spawnStopTime || Dash.DEFAULT_SPAWN_STOP_TIME; // try all interval - this.tryAllInterval = options.tryAllInterval || Bitcoin.DEFAULT_TRY_ALL_INTERVAL; - this.startRetryInterval = options.startRetryInterval || Bitcoin.DEFAULT_START_RETRY_INTERVAL; + this.tryAllInterval = options.tryAllInterval || Dash.DEFAULT_TRY_ALL_INTERVAL; + this.startRetryInterval = options.startRetryInterval || Dash.DEFAULT_START_RETRY_INTERVAL; // rpc limits - this.transactionConcurrency = options.transactionConcurrency || Bitcoin.DEFAULT_TRANSACTION_CONCURRENCY; + this.transactionConcurrency = options.transactionConcurrency || Dash.DEFAULT_TRANSACTION_CONCURRENCY; // sync progress level when zmq subscribes to events - this.zmqSubscribeProgress = options.zmqSubscribeProgress || Bitcoin.DEFAULT_ZMQ_SUBSCRIBE_PROGRESS; -}; - -Bitcoin.prototype._initCaches = function() { + this.zmqSubscribeProgress = options.zmqSubscribeProgress || Dash.DEFAULT_ZMQ_SUBSCRIBE_PROGRESS; +}; + +Dash.prototype._initCaches = function() { + + var CACHES = [ + {name:'utxos', lru:50000}, + {name:'txids', lru:50000}, + {name:'balance', lru:50000}, + {name:'summary', lru:50000}, + {name:'blockOverview', lru:144}, + {name:'transactionDetailed', lru:100000}, + {name:'masternodeList', lru:50000}, + {name:'sporksList', lru:50}, + //governance + {name:'gov', lru:20}, + + //cache valid indefinitely + {name:'transaction', lru:100000}, + {name:'rawTransaction', lru:50000}, + {name:'block', lru:144}, + {name:'rawBlock', lru:72}, + {name:'blockHeader', lru:288} + ]; + var self = this; + CACHES.forEach(function (el) { + self[el.name+'Cache']=LRU(el.lru); + }); // caches valid until there is a new block - this.utxosCache = LRU(50000); - this.txidsCache = LRU(50000); - this.balanceCache = LRU(50000); - this.summaryCache = LRU(50000); - this.blockOverviewCache = LRU(144); - this.transactionDetailedCache = LRU(100000); - this.masternodeListCache = LRU(50000); - this.sporksListCache = LRU(50); - - // caches valid indefinitely - this.transactionCache = LRU(100000); - this.rawTransactionCache = LRU(50000); - this.blockCache = LRU(144); - this.rawBlockCache = LRU(72); - this.blockHeaderCache = LRU(288); + this.zmqKnownTransactions = LRU(5000); this.zmqKnownTransactionLocks = LRU(5000); this.zmqKnownBlocks = LRU(50); this.lastTip = 0; this.lastTipTimeout = false; + }; -Bitcoin.prototype._initClients = function() { +Dash.prototype._initClients = function() { var self = this; this.nodes = []; this.nodesIndex = 0; @@ -162,7 +173,7 @@ Bitcoin.prototype._initClients = function() { /** * Called by Node to determine the available API methods. */ -Bitcoin.prototype.getAPIMethods = function() { +Dash.prototype.getAPIMethods = function() { var methods = [ ['getBlock', this, this.getBlock, 1], ['getRawBlock', this, this.getRawBlock, 1], @@ -194,28 +205,28 @@ Bitcoin.prototype.getAPIMethods = function() { /** * Called by the Bus to determine the available events. */ -Bitcoin.prototype.getPublishEvents = function() { +Dash.prototype.getPublishEvents = function() { return [ { - name: 'bitcoind/rawtransaction', + name: 'dashd/rawtransaction', scope: this, subscribe: this.subscribe.bind(this, 'rawtransaction'), unsubscribe: this.unsubscribe.bind(this, 'rawtransaction') }, { - name: 'bitcoind/transactionlock', + name: 'dashd/transactionlock', scope: this, subscribe: this.subscribe.bind(this, 'transactionlock'), unsubscribe: this.unsubscribe.bind(this, 'transactionlock') }, { - name: 'bitcoind/hashblock', + name: 'dashd/hashblock', scope: this, subscribe: this.subscribe.bind(this, 'hashblock'), unsubscribe: this.unsubscribe.bind(this, 'hashblock') }, { - name: 'bitcoind/addresstxid', + name: 'dashd/addresstxid', scope: this, subscribe: this.subscribeAddress.bind(this), unsubscribe: this.unsubscribeAddress.bind(this) @@ -223,20 +234,20 @@ Bitcoin.prototype.getPublishEvents = function() { ]; }; -Bitcoin.prototype.subscribe = function(name, emitter) { +Dash.prototype.subscribe = function(name, emitter) { this.subscriptions[name].push(emitter); - log.info(emitter.remoteAddress, 'subscribe:', 'bitcoind/' + name, 'total:', this.subscriptions[name].length); + log.info(emitter.remoteAddress, 'subscribe:', 'dashd/' + name, 'total:', this.subscriptions[name].length); }; -Bitcoin.prototype.unsubscribe = function(name, emitter) { +Dash.prototype.unsubscribe = function(name, emitter) { var index = this.subscriptions[name].indexOf(emitter); if (index > -1) { this.subscriptions[name].splice(index, 1); } - log.info(emitter.remoteAddress, 'unsubscribe:', 'bitcoind/' + name, 'total:', this.subscriptions[name].length); + log.info(emitter.remoteAddress, 'unsubscribe:', 'dashd/' + name, 'total:', this.subscriptions[name].length); }; -Bitcoin.prototype.subscribeAddress = function(emitter, addresses) { +Dash.prototype.subscribeAddress = function(emitter, addresses) { var self = this; function addAddress(addressStr) { @@ -250,17 +261,18 @@ Bitcoin.prototype.subscribeAddress = function(emitter, addresses) { self.subscriptions.address[addressStr] = [emitter]; } } - - for(var i = 0; i < addresses.length; i++) { - if (bitcore.Address.isValid(addresses[i], this.node.network)) { - addAddress(addresses[i]); + if(addresses){ + for(var i = 0; i < addresses.length; i++) { + if (dashcore.Address.isValid(addresses[i], this.node.network)) { + addAddress(addresses[i]); + } } } - log.info(emitter.remoteAddress, 'subscribe:', 'bitcoind/addresstxid', 'total:', _.size(this.subscriptions.address)); + log.info(emitter.remoteAddress, 'subscribe:', 'dashd/addresstxid', 'total:', _.size(this.subscriptions.address)); }; -Bitcoin.prototype.unsubscribeAddress = function(emitter, addresses) { +Dash.prototype.unsubscribeAddress = function(emitter, addresses) { var self = this; if(!addresses) { return this.unsubscribeAddressAll(emitter); @@ -283,7 +295,7 @@ Bitcoin.prototype.unsubscribeAddress = function(emitter, addresses) { } } - log.info(emitter.remoteAddress, 'unsubscribe:', 'bitcoind/addresstxid', 'total:', _.size(this.subscriptions.address)); + log.info(emitter.remoteAddress, 'unsubscribe:', 'dashd/addresstxid', 'total:', _.size(this.subscriptions.address)); }; /** @@ -291,7 +303,7 @@ Bitcoin.prototype.unsubscribeAddress = function(emitter, addresses) { * @param {String} name - The name of the event * @param {EventEmitter} emitter - An instance of an event emitter */ -Bitcoin.prototype.unsubscribeAddressAll = function(emitter) { +Dash.prototype.unsubscribeAddressAll = function(emitter) { for(var hashHex in this.subscriptions.address) { var emitters = this.subscriptions.address[hashHex]; var index = emitters.indexOf(emitter); @@ -302,19 +314,19 @@ Bitcoin.prototype.unsubscribeAddressAll = function(emitter) { delete this.subscriptions.address[hashHex]; } } - log.info(emitter.remoteAddress, 'unsubscribe:', 'bitcoind/addresstxid', 'total:', _.size(this.subscriptions.address)); + log.info(emitter.remoteAddress, 'unsubscribe:', 'dashd/addresstxid', 'total:', _.size(this.subscriptions.address)); }; -Bitcoin.prototype._getDefaultConfig = function() { +Dash.prototype._getDefaultConfig = function() { var config = ''; - var defaults = Bitcoin.DEFAULT_CONFIG_SETTINGS; + var defaults = Dash.DEFAULT_CONFIG_SETTINGS; for(var key in defaults) { config += key + '=' + defaults[key] + '\n'; } return config; }; -Bitcoin.prototype._parseBitcoinConf = function(configPath) { +Dash.prototype._parseDashConf = function(configPath) { var options = {}; var file = fs.readFileSync(configPath); var unparsed = file.toString().split('\n'); @@ -334,7 +346,7 @@ Bitcoin.prototype._parseBitcoinConf = function(configPath) { return options; }; -Bitcoin.prototype._expandRelativeDatadir = function() { +Dash.prototype._expandRelativeDatadir = function() { if (!utils.isAbsolutePath(this.options.spawn.datadir)) { $.checkState(this.node.configPath); $.checkState(utils.isAbsolutePath(this.node.configPath)); @@ -343,7 +355,7 @@ Bitcoin.prototype._expandRelativeDatadir = function() { } }; -Bitcoin.prototype._loadSpawnConfiguration = function(node) { +Dash.prototype._loadSpawnConfiguration = function(node) { /* jshint maxstatements: 25 */ $.checkArgument(this.options.spawn, 'Please specify "spawn" in dashd config options'); @@ -355,7 +367,7 @@ Bitcoin.prototype._loadSpawnConfiguration = function(node) { var spawnOptions = this.options.spawn; var configPath = path.resolve(spawnOptions.datadir, './dash.conf'); - log.info('Using bitcoin config file:', configPath); + log.info('Using Dash config file:', configPath); this.spawn = {}; this.spawn.datadir = this.options.spawn.datadir; @@ -373,11 +385,11 @@ Bitcoin.prototype._loadSpawnConfiguration = function(node) { } _.extend(this.spawn.config, this._getDefaultConf()); - _.extend(this.spawn.config, this._parseBitcoinConf(configPath)); + _.extend(this.spawn.config, this._parseDashConf(configPath)); var networkConfigPath = this._getNetworkConfigPath(); if (networkConfigPath && fs.existsSync(networkConfigPath)) { - _.extend(this.spawn.config, this._parseBitcoinConf(networkConfigPath)); + _.extend(this.spawn.config, this._parseDashConf(networkConfigPath)); } var spawnConfig = this.spawn.config; @@ -386,31 +398,31 @@ Bitcoin.prototype._loadSpawnConfiguration = function(node) { }; -Bitcoin.prototype._checkConfigIndexes = function(spawnConfig, node) { +Dash.prototype._checkConfigIndexes = function(spawnConfig, node) { $.checkState( spawnConfig.txindex && spawnConfig.txindex === 1, - '"txindex" option is required in order to use transaction query features of bitcore-node-dash. ' + + '"txindex" option is required in order to use transaction query features of dashcore-node. ' + 'Please add "txindex=1" to your configuration and reindex an existing database if ' + 'necessary with reindex=1' ); $.checkState( spawnConfig.addressindex && spawnConfig.addressindex === 1, - '"addressindex" option is required in order to use address query features of bitcore-node-dash. ' + + '"addressindex" option is required in order to use address query features of dashcore-node. ' + 'Please add "addressindex=1" to your configuration and reindex an existing database if ' + 'necessary with reindex=1' ); $.checkState( spawnConfig.spentindex && spawnConfig.spentindex === 1, - '"spentindex" option is required in order to use spent info query features of bitcore-node-dash. ' + + '"spentindex" option is required in order to use spent info query features of dashcore-node. ' + 'Please add "spentindex=1" to your configuration and reindex an existing database if ' + 'necessary with reindex=1' ); $.checkState( spawnConfig.server && spawnConfig.server === 1, - '"server" option is required to communicate to dashd from bitcore. ' + + '"server" option is required to communicate to dashd from dashcore. ' + 'Please add "server=1" to your configuration and restart' ); @@ -434,19 +446,19 @@ Bitcoin.prototype._checkConfigIndexes = function(spawnConfig, node) { $.checkState( (spawnConfig.zmqpubhashblock === spawnConfig.zmqpubrawtx), - '"zmqpubrawtx" and "zmqpubhashblock" are expected to the same host and port in bitcoin.conf' + '"zmqpubrawtx" and "zmqpubhashblock" are expected to the same host and port in dash.conf' ); if (spawnConfig.reindex && spawnConfig.reindex === 1) { log.warn('Reindex option is currently enabled. This means that dashd is undergoing a reindex. ' + 'The reindex flag will start the index from beginning every time the node is started, so it ' + 'should be removed after the reindex has been initiated. Once the reindex is complete, the rest ' + - 'of bitcore-node-dash services will start.'); + 'of dashcore-node services will start.'); node._reindex = true; } }; -Bitcoin.prototype._resetCaches = function() { +Dash.prototype._resetCaches = function() { this.transactionDetailedCache.reset(); this.utxosCache.reset(); this.txidsCache.reset(); @@ -455,6 +467,8 @@ Bitcoin.prototype._resetCaches = function() { this.blockOverviewCache.reset(); this.masternodeListCache.reset(); this.sporksListCache.reset(); + this.govCache.del('info'); + this.govCache.del('count'); }; /** @@ -464,7 +478,7 @@ Bitcoin.prototype._resetCaches = function() { * @param callback * @private */ -Bitcoin.prototype._tryAllClients = function(func, callback) { +Dash.prototype._tryAllClients = function(func, callback) { var self = this; //Storing current node index into closure var nextClientToTry = this.nodesIndex; @@ -478,13 +492,13 @@ Bitcoin.prototype._tryAllClients = function(func, callback) { async.retry({times: this.nodes.length, interval: this.tryAllInterval || 1000}, retry, callback); }; -Bitcoin.prototype._wrapRPCError = function(errObj) { +Dash.prototype._wrapRPCError = function(errObj) { var err = new errors.RPCError(errObj.message); err.code = errObj.code; return err; }; -Bitcoin.prototype._initChain = function(callback) { +Dash.prototype._initChain = function(callback) { var self = this; self.client.getBestBlockHash(function(err, response) { @@ -519,19 +533,19 @@ Bitcoin.prototype._initChain = function(callback) { }); }; -Bitcoin.prototype._getDefaultConf = function() { +Dash.prototype._getDefaultConf = function() { var networkOptions = { rpcport: 9998 }; - if (this.node.network === bitcore.Networks.testnet) { + if (this.node.network === dashcore.Networks.testnet) { networkOptions.rpcport = 19998; } return networkOptions; }; -Bitcoin.prototype._getNetworkConfigPath = function() { +Dash.prototype._getNetworkConfigPath = function() { var networkPath; - if (this.node.network === bitcore.Networks.testnet) { + if (this.node.network === dashcore.Networks.testnet) { networkPath = 'testnet3/dash.conf'; if (this.node.network.regtestEnabled) { networkPath = 'regtest/dash.conf'; @@ -540,9 +554,9 @@ Bitcoin.prototype._getNetworkConfigPath = function() { return networkPath; }; -Bitcoin.prototype._getNetworkOption = function() { +Dash.prototype._getNetworkOption = function() { var networkOption; - if (this.node.network === bitcore.Networks.testnet) { + if (this.node.network === dashcore.Networks.testnet) { networkOption = '--testnet'; if (this.node.network.regtestEnabled) { networkOption = '--regtest'; @@ -551,7 +565,7 @@ Bitcoin.prototype._getNetworkOption = function() { return networkOption; }; -Bitcoin.prototype._zmqBlockHandler = function(node, message) { +Dash.prototype._zmqBlockHandler = function(node, message) { var self = this; // Update the current chain tip @@ -564,13 +578,13 @@ Bitcoin.prototype._zmqBlockHandler = function(node, message) { self.emit('block', message); for (var i = 0; i < this.subscriptions.hashblock.length; i++) { - this.subscriptions.hashblock[i].emit('bitcoind/hashblock', message.toString('hex')); + this.subscriptions.hashblock[i].emit('dashd/hashblock', message.toString('hex')); } } }; -Bitcoin.prototype._rapidProtectedUpdateTip = function(node, message) { +Dash.prototype._rapidProtectedUpdateTip = function(node, message) { var self = this; // Prevent a rapid succession of tip updates @@ -585,7 +599,7 @@ Bitcoin.prototype._rapidProtectedUpdateTip = function(node, message) { } }; -Bitcoin.prototype._updateTip = function(node, message) { +Dash.prototype._updateTip = function(node, message) { var self = this; var hex = message.toString('hex'); @@ -621,7 +635,7 @@ Bitcoin.prototype._updateTip = function(node, message) { } }; -Bitcoin.prototype._getAddressesFromTransaction = function(transaction) { +Dash.prototype._getAddressesFromTransaction = function(transaction) { var addresses = []; for (var i = 0; i < transaction.inputs.length; i++) { @@ -647,14 +661,14 @@ Bitcoin.prototype._getAddressesFromTransaction = function(transaction) { return _.uniq(addresses); }; -Bitcoin.prototype._notifyAddressTxidSubscribers = function(txid, transaction) { +Dash.prototype._notifyAddressTxidSubscribers = function(txid, transaction) { var addresses = this._getAddressesFromTransaction(transaction); for (var i = 0; i < addresses.length; i++) { var address = addresses[i]; if(this.subscriptions.address[address]) { var emitters = this.subscriptions.address[address]; for(var j = 0; j < emitters.length; j++) { - emitters[j].emit('bitcoind/addresstxid', { + emitters[j].emit('dashd/addresstxid', { address: address, txid: txid }); @@ -663,9 +677,9 @@ Bitcoin.prototype._notifyAddressTxidSubscribers = function(txid, transaction) { } }; -Bitcoin.prototype._zmqTransactionHandler = function(node, message) { +Dash.prototype._zmqTransactionHandler = function(node, message) { var self = this; - var hash = bitcore.crypto.Hash.sha256sha256(message); + var hash = dashcore.crypto.Hash.sha256sha256(message); var id = hash.toString('binary'); if (!self.zmqKnownTransactions.get(id)) { self.zmqKnownTransactions.set(id, true); @@ -673,20 +687,20 @@ Bitcoin.prototype._zmqTransactionHandler = function(node, message) { // Notify transaction subscribers for (var i = 0; i < this.subscriptions.rawtransaction.length; i++) { - this.subscriptions.rawtransaction[i].emit('bitcoind/rawtransaction', message.toString('hex')); + this.subscriptions.rawtransaction[i].emit('dashd/rawtransaction', message.toString('hex')); } - var tx = bitcore.Transaction(); + var tx = dashcore.Transaction(); tx.fromString(message); - var txid = bitcore.util.buffer.reverse(hash).toString('hex'); + var txid = dashcore.util.buffer.reverse(hash).toString('hex'); self._notifyAddressTxidSubscribers(txid, tx); } }; -Bitcoin.prototype._zmqTransactionLockHandler = function(node, message) { +Dash.prototype._zmqTransactionLockHandler = function(node, message) { var self = this; - var hash = bitcore.crypto.Hash.sha256sha256(message); + var hash = dashcore.crypto.Hash.sha256sha256(message); var id = hash.toString('binary'); if (!self.zmqKnownTransactionLocks.get(id)) { self.zmqKnownTransactionLocks.set(id, true); @@ -694,13 +708,13 @@ Bitcoin.prototype._zmqTransactionLockHandler = function(node, message) { // Notify transaction lock subscribers for (var i = 0; i < this.subscriptions.transactionlock.length; i++) { - this.subscriptions.transactionlock[i].emit('bitcoind/transactionlock', message.toString('hex')); + this.subscriptions.transactionlock[i].emit('dashd/transactionlock', message.toString('hex')); } } }; -Bitcoin.prototype._checkSyncedAndSubscribeZmqEvents = function(node) { +Dash.prototype._checkSyncedAndSubscribeZmqEvents = function(node) { var self = this; var interval; @@ -746,13 +760,13 @@ Bitcoin.prototype._checkSyncedAndSubscribeZmqEvents = function(node) { log.error(err); } }); - }, node._tipUpdateInterval || Bitcoin.DEFAULT_TIP_UPDATE_INTERVAL); + }, node._tipUpdateInterval || Dash.DEFAULT_TIP_UPDATE_INTERVAL); } }); }; -Bitcoin.prototype._subscribeZmqEvents = function(node) { +Dash.prototype._subscribeZmqEvents = function(node) { var self = this; node.zmqSubSocket.subscribe('hashblock'); node.zmqSubSocket.subscribe('rawtx'); @@ -769,7 +783,7 @@ Bitcoin.prototype._subscribeZmqEvents = function(node) { }); }; -Bitcoin.prototype._initZmqSubSocket = function(node, zmqUrl) { +Dash.prototype._initZmqSubSocket = function(node, zmqUrl) { var self = this; node.zmqSubSocket = zmq.socket('sub'); @@ -796,7 +810,7 @@ Bitcoin.prototype._initZmqSubSocket = function(node, zmqUrl) { node.zmqSubSocket.connect(zmqUrl); }; -Bitcoin.prototype._checkReindex = function(node, callback) { +Dash.prototype._checkReindex = function(node, callback) { var self = this; var interval; function finish(err) { @@ -820,11 +834,11 @@ Bitcoin.prototype._checkReindex = function(node, callback) { finish(); } }); - }, node._reindexWait || Bitcoin.DEFAULT_REINDEX_INTERVAL); + }, node._reindexWait || Dash.DEFAULT_REINDEX_INTERVAL); }; -Bitcoin.prototype._loadTipFromNode = function(node, callback) { +Dash.prototype._loadTipFromNode = function(node, callback) { var self = this; node.client.getBestBlockHash(function(err, response) { if (err && err.code === -28) { @@ -845,7 +859,7 @@ Bitcoin.prototype._loadTipFromNode = function(node, callback) { }); }; -Bitcoin.prototype._stopSpawnedBitcoin = function(callback) { +Dash.prototype._stopSpawnedDash = function(callback) { var self = this; var spawnOptions = this.options.spawn; var pidPath = spawnOptions.datadir + '/dashd.pid'; @@ -883,7 +897,7 @@ Bitcoin.prototype._stopSpawnedBitcoin = function(callback) { stopProcess(); }; -Bitcoin.prototype._spawnChildProcess = function(callback) { +Dash.prototype._spawnChildProcess = function(callback) { var self = this; var node = {}; @@ -905,7 +919,7 @@ Bitcoin.prototype._spawnChildProcess = function(callback) { options.push(self._getNetworkOption()); } - self._stopSpawnedBitcoin(function(err) { + self._stopSpawnedDash(function(err) { if (err) { return callback(err); } @@ -940,7 +954,7 @@ Bitcoin.prototype._spawnChildProcess = function(callback) { return done(); } - node.client = new BitcoinRPC({ + node.client = new DashdRPC({ protocol: 'http', host: '127.0.0.1', port: self.spawn.config.rpcport, @@ -974,7 +988,7 @@ Bitcoin.prototype._spawnChildProcess = function(callback) { }; -Bitcoin.prototype._connectProcess = function(config, callback) { +Dash.prototype._connectProcess = function(config, callback) { var self = this; var node = {}; var exitShutdown = false; @@ -985,7 +999,7 @@ Bitcoin.prototype._connectProcess = function(config, callback) { return done(); } - node.client = new BitcoinRPC({ + node.client = new DashdRPC({ protocol: config.rpcprotocol || 'http', host: config.rpchost || '127.0.0.1', port: config.rpcport, @@ -1015,7 +1029,7 @@ Bitcoin.prototype._connectProcess = function(config, callback) { * Called by Node to start the service * @param {Function} callback */ -Bitcoin.prototype.start = function(callback) { +Dash.prototype.start = function(callback) { var self = this; async.series([ @@ -1052,7 +1066,7 @@ Bitcoin.prototype.start = function(callback) { return callback(err); } if (self.nodes.length === 0) { - return callback(new Error('Bitcoin configuration options "spawn" or "connect" are expected')); + return callback(new Error('Dash configuration options "spawn" or "connect" are expected')); } self._initChain(callback); }); @@ -1063,7 +1077,7 @@ Bitcoin.prototype.start = function(callback) { * Helper to determine the state of the database. * @param {Function} callback */ -Bitcoin.prototype.isSynced = function(callback) { +Dash.prototype.isSynced = function(callback) { this.syncPercentage(function(err, percentage) { if (err) { return callback(err); @@ -1080,7 +1094,7 @@ Bitcoin.prototype.isSynced = function(callback) { * Helper to determine the progress of the database. * @param {Function} callback */ -Bitcoin.prototype.syncPercentage = function(callback) { +Dash.prototype.syncPercentage = function(callback) { var self = this; this.client.getBlockchainInfo(function(err, response) { if (err) { @@ -1091,7 +1105,7 @@ Bitcoin.prototype.syncPercentage = function(callback) { }); }; -Bitcoin.prototype._normalizeAddressArg = function(addressArg) { +Dash.prototype._normalizeAddressArg = function(addressArg) { var addresses = [addressArg]; if (Array.isArray(addressArg)) { addresses = addressArg; @@ -1101,11 +1115,11 @@ Bitcoin.prototype._normalizeAddressArg = function(addressArg) { /** * Will get the balance for an address or multiple addresses - * @param {String|Address|Array} addressArg - An address string, bitcore address, or array of addresses + * @param {String|Address|Array} addressArg - An address string, dashcore address, or array of addresses * @param {Object} options * @param {Function} callback */ -Bitcoin.prototype.getAddressBalance = function(addressArg, options, callback) { +Dash.prototype.getAddressBalance = function(addressArg, options, callback) { var self = this; var addresses = self._normalizeAddressArg(addressArg); var cacheKey = addresses.join(''); @@ -1127,11 +1141,11 @@ Bitcoin.prototype.getAddressBalance = function(addressArg, options, callback) { /** * Will get the unspent outputs for an address or multiple addresses - * @param {String|Address|Array} addressArg - An address string, bitcore address, or array of addresses + * @param {String|Address|Array} addressArg - An address string, dashcore address, or array of addresses * @param {Object} options * @param {Function} callback */ -Bitcoin.prototype.getAddressUnspentOutputs = function(addressArg, options, callback) { +Dash.prototype.getAddressUnspentOutputs = function(addressArg, options, callback) { var self = this; var queryMempool = _.isUndefined(options.queryMempool) ? true : options.queryMempool; var addresses = self._normalizeAddressArg(addressArg); @@ -1139,7 +1153,7 @@ Bitcoin.prototype.getAddressUnspentOutputs = function(addressArg, options, callb var utxos = self.utxosCache.get(cacheKey); function transformUnspentOutput(delta) { - var script = bitcore.Script.fromAddress(delta.address); + var script = dashcore.Script.fromAddress(delta.address); return { address: delta.address, txid: delta.txid, @@ -1218,7 +1232,7 @@ Bitcoin.prototype.getAddressUnspentOutputs = function(addressArg, options, callb }; -Bitcoin.prototype._getBalanceFromMempool = function(deltas) { +Dash.prototype._getBalanceFromMempool = function(deltas) { var satoshis = 0; for (var i = 0; i < deltas.length; i++) { satoshis += deltas[i].satoshis; @@ -1226,7 +1240,7 @@ Bitcoin.prototype._getBalanceFromMempool = function(deltas) { return satoshis; }; -Bitcoin.prototype._getTxidsFromMempool = function(deltas) { +Dash.prototype._getTxidsFromMempool = function(deltas) { var mempoolTxids = []; var mempoolTxidsKnown = {}; for (var i = 0; i < deltas.length; i++) { @@ -1239,13 +1253,13 @@ Bitcoin.prototype._getTxidsFromMempool = function(deltas) { return mempoolTxids; }; -Bitcoin.prototype._getHeightRangeQuery = function(options, clone) { +Dash.prototype._getHeightRangeQuery = function(options, clone) { if (options.start >= 0 && options.end >= 0) { if (options.end > options.start) { throw new TypeError('"end" is expected to be less than or equal to "start"'); } if (clone) { - // reverse start and end as the order in bitcore is most recent to less recent + // reverse start and end as the order in dashcore is most recent to less recent clone.start = options.end; clone.end = options.start; } @@ -1256,11 +1270,11 @@ Bitcoin.prototype._getHeightRangeQuery = function(options, clone) { /** * Will get the txids for an address or multiple addresses - * @param {String|Address|Array} addressArg - An address string, bitcore address, or array of addresses + * @param {String|Address|Array} addressArg - An address string, dashcore address, or array of addresses * @param {Object} options * @param {Function} callback */ -Bitcoin.prototype.getAddressTxids = function(addressArg, options, callback) { +Dash.prototype.getAddressTxids = function(addressArg, options, callback) { /* jshint maxstatements: 16 */ var self = this; var queryMempool = _.isUndefined(options.queryMempool) ? true : options.queryMempool; @@ -1319,7 +1333,7 @@ Bitcoin.prototype.getAddressTxids = function(addressArg, options, callback) { }; -Bitcoin.prototype._getConfirmationsDetail = function(transaction) { +Dash.prototype._getConfirmationsDetail = function(transaction) { $.checkState(this.height > 0, 'current height is unknown'); var confirmations = 0; if (transaction.height >= 0) { @@ -1331,7 +1345,7 @@ Bitcoin.prototype._getConfirmationsDetail = function(transaction) { return Math.max(0, confirmations); }; -Bitcoin.prototype._getAddressDetailsForInput = function(input, inputIndex, result, addressStrings) { +Dash.prototype._getAddressDetailsForInput = function(input, inputIndex, result, addressStrings) { if (!input.address) { return; } @@ -1349,7 +1363,7 @@ Bitcoin.prototype._getAddressDetailsForInput = function(input, inputIndex, resul } }; -Bitcoin.prototype._getAddressDetailsForOutput = function(output, outputIndex, result, addressStrings) { +Dash.prototype._getAddressDetailsForOutput = function(output, outputIndex, result, addressStrings) { if (!output.address) { return; } @@ -1367,7 +1381,7 @@ Bitcoin.prototype._getAddressDetailsForOutput = function(output, outputIndex, re } }; -Bitcoin.prototype._getAddressDetailsForTransaction = function(transaction, addressStrings) { +Dash.prototype._getAddressDetailsForTransaction = function(transaction, addressStrings) { var result = { addresses: {}, satoshis: 0 @@ -1393,7 +1407,7 @@ Bitcoin.prototype._getAddressDetailsForTransaction = function(transaction, addre * @param {Object} txid - A dash transaction id * @param {Function} callback */ -Bitcoin.prototype._getAddressDetailedTransaction = function(txid, options, next) { +Dash.prototype._getAddressDetailedTransaction = function(txid, options, next) { var self = this; self.getDetailedTransaction( @@ -1416,11 +1430,11 @@ Bitcoin.prototype._getAddressDetailedTransaction = function(txid, options, next) ); }; -Bitcoin.prototype._getAddressStrings = function(addresses) { +Dash.prototype._getAddressStrings = function(addresses) { var addressStrings = []; for (var i = 0; i < addresses.length; i++) { var address = addresses[i]; - if (address instanceof bitcore.Address) { + if (address instanceof dashcore.Address) { addressStrings.push(address.toString()); } else if (_.isString(address)) { addressStrings.push(address); @@ -1431,7 +1445,7 @@ Bitcoin.prototype._getAddressStrings = function(addresses) { return addressStrings; }; -Bitcoin.prototype._paginateTxids = function(fullTxids, fromArg, toArg) { +Dash.prototype._paginateTxids = function(fullTxids, fromArg, toArg) { var txids; var from = parseInt(fromArg); var to = parseInt(toArg); @@ -1442,11 +1456,11 @@ Bitcoin.prototype._paginateTxids = function(fullTxids, fromArg, toArg) { /** * Will detailed transaction history for an address or multiple addresses - * @param {String|Address|Array} addressArg - An address string, bitcore address, or array of addresses + * @param {String|Address|Array} addressArg - An address string, dashcore address, or array of addresses * @param {Object} options * @param {Function} callback */ -Bitcoin.prototype.getAddressHistory = function(addressArg, options, callback) { +Dash.prototype.getAddressHistory = function(addressArg, options, callback) { var self = this; var addresses = self._normalizeAddressArg(addressArg); if (addresses.length > this.maxAddressesQuery) { @@ -1502,11 +1516,11 @@ Bitcoin.prototype.getAddressHistory = function(addressArg, options, callback) { /** * Will get the summary including txids and balance for an address or multiple addresses - * @param {String|Address|Array} addressArg - An address string, bitcore address, or array of addresses + * @param {String|Address|Array} addressArg - An address string, dashcore address, or array of addresses * @param {Object} options * @param {Function} callback */ -Bitcoin.prototype.getAddressSummary = function(addressArg, options, callback) { +Dash.prototype.getAddressSummary = function(addressArg, options, callback) { var self = this; var summary = {}; var queryMempool = _.isUndefined(options.queryMempool) ? true : options.queryMempool; @@ -1608,7 +1622,7 @@ Bitcoin.prototype.getAddressSummary = function(addressArg, options, callback) { * @param {Function} callback * @private */ -Bitcoin.prototype._maybeGetBlockHash = function(blockArg, callback) { +Dash.prototype._maybeGetBlockHash = function(blockArg, callback) { var self = this; if (_.isNumber(blockArg) || (blockArg.length < 40 && /^[0-9]+$/.test(blockArg))) { self._tryAllClients(function(client, done) { @@ -1629,7 +1643,7 @@ Bitcoin.prototype._maybeGetBlockHash = function(blockArg, callback) { * @param {String|Number} block - A block hash or block height number * @param {Function} callback */ -Bitcoin.prototype.getRawBlock = function(blockArg, callback) { +Dash.prototype.getRawBlock = function(blockArg, callback) { // TODO apply performance patch to the RPC method for raw data var self = this; @@ -1664,7 +1678,7 @@ Bitcoin.prototype.getRawBlock = function(blockArg, callback) { * @param {String|Number} block - A block hash or block height number * @param {Function} callback */ -Bitcoin.prototype.getBlockOverview = function(blockArg, callback) { +Dash.prototype.getBlockOverview = function(blockArg, callback) { var self = this; function queryBlock(err, blockhash) { @@ -1710,11 +1724,11 @@ Bitcoin.prototype.getBlockOverview = function(blockArg, callback) { }; /** - * Will retrieve a block as a Bitcore object + * Will retrieve a block as a Dashcore object * @param {String|Number} block - A block hash or block height number * @param {Function} callback */ -Bitcoin.prototype.getBlock = function(blockArg, callback) { +Dash.prototype.getBlock = function(blockArg, callback) { // TODO apply performance patch to the RPC method for raw data var self = this; @@ -1733,7 +1747,7 @@ Bitcoin.prototype.getBlock = function(blockArg, callback) { if (err) { return done(self._wrapRPCError(err)); } - var blockObj = bitcore.Block.fromString(response.result); + var blockObj = dashcore.Block.fromString(response.result); self.blockCache.set(blockhash, blockObj); done(null, blockObj); }); @@ -1750,7 +1764,7 @@ Bitcoin.prototype.getBlock = function(blockArg, callback) { * @param {Number} low - The older timestamp in seconds * @param {Function} callback */ -Bitcoin.prototype.getBlockHashesByTimestamp = function(high, low, callback) { +Dash.prototype.getBlockHashesByTimestamp = function(high, low, callback) { var self = this; self.client.getBlockHashes(high, low, function(err, response) { if (err) { @@ -1780,7 +1794,7 @@ Bitcoin.prototype.getBlockHashesByTimestamp = function(high, low, callback) { * @param {String|Number} block - A block hash or block height * @param {Function} callback */ -Bitcoin.prototype.getBlockHeader = function(blockArg, callback) { +Dash.prototype.getBlockHeader = function(blockArg, callback) { var self = this; function queryHeader(err, blockhash) { @@ -1837,16 +1851,16 @@ Bitcoin.prototype.getBlockHeader = function(blockArg, callback) { * @param {Function} callback * @param {String|Number} nbOfBlockToFetch - A value allowing to choose how many block to fetch */ -Bitcoin.prototype.getBlockHeaders = function(blockArg, callback, nbOfBlockToFetch) { +Dash.prototype.getBlockHeaders = function(blockArg, callback, nbOfBlockToFetch) { var self = this; var _toFetch = 25; if (nbOfBlockToFetch) { - if (nbOfBlockToFetch.constructor.name === "String" && !isNaN(parseInt(nbOfBlockToFetch))) { + if (nbOfBlockToFetch.constructor.name === 'String' && !isNaN(parseInt(nbOfBlockToFetch))) { _toFetch = parseInt(nbOfBlockToFetch); } - if (nbOfBlockToFetch.constructor.name === "Number") { + if (nbOfBlockToFetch.constructor.name === 'Number') { _toFetch = nbOfBlockToFetch; } if (_toFetch > 250) { @@ -1886,7 +1900,7 @@ Bitcoin.prototype.getBlockHeaders = function(blockArg, callback, nbOfBlockToFetc * @param {Number} blocks - The number of blocks for the transaction to be confirmed. * @param {Function} callback */ -Bitcoin.prototype.estimateFee = function(blocks, callback) { +Dash.prototype.estimateFee = function(blocks, callback) { var self = this; this.client.estimateFee(blocks, function(err, response) { if (err) { @@ -1903,7 +1917,7 @@ Bitcoin.prototype.estimateFee = function(blocks, callback) { * @param {Boolean=} options.allowAbsurdFees - Enable large fees * @param {Function} callback */ -Bitcoin.prototype.sendTransaction = function(tx, options, callback) { +Dash.prototype.sendTransaction = function(tx, options, callback) { var self = this; var allowAbsurdFees = false; var isInstantSend = false; @@ -1927,7 +1941,7 @@ Bitcoin.prototype.sendTransaction = function(tx, options, callback) { }; -Bitcoin.prototype._getRawTransactionData = function(txid, callback) { +Dash.prototype._getRawTransactionData = function(txid, callback) { var self = this; self._tryAllClients(function(client, done) { client.getRawTransaction(txid, function(err, response) { @@ -1944,7 +1958,7 @@ Bitcoin.prototype._getRawTransactionData = function(txid, callback) { * @param {String} txid - The transaction hash * @param {Function} callback */ -Bitcoin.prototype.getRawTransaction = function(txid, callback) { +Dash.prototype.getRawTransaction = function(txid, callback) { var self = this; var tx = self.rawTransactionCache.get(txid); if (tx) { @@ -1964,12 +1978,12 @@ Bitcoin.prototype.getRawTransaction = function(txid, callback) { }; /** - * Will get a transaction as a Bitcore Transaction. Results include the mempool. + * Will get a transaction as a Dashcore Transaction. Results include the mempool. * @param {String} txid - The transaction hash * @param {Boolean} queryMempool - Include the mempool * @param {Function} callback */ -Bitcoin.prototype.getTransaction = function(txid, callback) { +Dash.prototype.getTransaction = function(txid, callback) { var self = this; var tx = self.transactionCache.get(txid); if (tx) { @@ -2031,7 +2045,7 @@ Bitcoin.prototype.getTransaction = function(txid, callback) { * @param {String} txid - The hex string of the transaction * @param {Function} callback */ -Bitcoin.prototype.getDetailedTransaction = function(txid, callback) { +Dash.prototype.getDetailedTransaction = function(txid, callback) { var self = this; var tx = self.transactionDetailedCache.get(txid); @@ -2087,11 +2101,11 @@ Bitcoin.prototype.getDetailedTransaction = function(txid, callback) { function addTxlockToTx(tx,result) { tx.txlock = false; - if (tx.feeSatoshis >= Bitcoin.DEFAULT_INSTANTSEND_FEE) { // if transaction fee is >= 0.0001 check for txlock - var rawTx = new bitcore.Transaction(result.hex); - var hash = bitcore.crypto.Hash.sha256sha256(rawTx.toBuffer()); + if (tx.feeSatoshis >= Dash.DEFAULT_INSTANTSEND_FEE) { // if transaction fee is >= 0.0001 check for txlock + var rawTx = new dashcore.Transaction(result.hex); + var hash = dashcore.crypto.Hash.sha256sha256(rawTx.toBuffer()); var id = hash.toString('binary'); - if (self.node.services.bitcoind.zmqKnownTransactionLocks.get(id)) { + if (self.node.services.dashd.zmqKnownTransactionLocks.get(id)) { tx.txlock = true; // if "txlock" notification received through ZMQ, set txlock = true } } @@ -2147,9 +2161,8 @@ Bitcoin.prototype.getDetailedTransaction = function(txid, callback) { * @param options - should be either "1" or "2", used to filter the object type * @param callback */ -Bitcoin.prototype.govObjectList = function(options, callback) { +Dash.prototype.govObjectList = function(options, callback) { var self = this; - this.client.gobject('list', function(err, response) { if (err) { return callback(self._wrapRPCError(err)); @@ -2160,7 +2173,6 @@ Bitcoin.prototype.govObjectList = function(options, callback) { for (var i = 0; i < gobjects.length; i++) { var proposal = new Proposal(response.result[gobjects[i]].DataHex); - if ((options.type && proposal.type === options.type)) { result.push({ Hash: gobjects[i], @@ -2188,7 +2200,57 @@ Bitcoin.prototype.govObjectList = function(options, callback) { }); }; -Bitcoin.prototype.govObjectCheck = function(hexdata, callback){ +Dash.prototype.getCurrentVotes = function (govhash, callback) { + var self = this; + this.client.gobject('getcurrentvotes', govhash, function(err, response) { + if (err) { + return callback(self._wrapRPCError(err)); + } + callback(null, response); + }); +}; + +Dash.prototype.getVotes = function (govhash, callback) { + var self = this; + this.client.gobject('getvotes', govhash, function(err, response) { + if (err) { + return callback(self._wrapRPCError(err)); + } + callback(null, response); + }); +}; + +Dash.prototype.getSuperBlockBudget = function (blockindex, callback) { + var self = this; + this.client.getsuperblockbudget(blockindex, function(err, response) { + if (err) { + return callback(self._wrapRPCError(err)); + } + callback(null, response); + }); +}; +/*jshint maxparams: 6 */ +Dash.prototype.govObjectSubmit = function (parentHash, revision, time, dataHex, feeTxId, callback) { + var self = this; + this.client.gobject('submit', parentHash, revision, time, dataHex, feeTxId, function(err, response) { + if (err) { + return callback(self._wrapRPCError(err)); + } + callback(null, response); + }); +}; + +Dash.prototype.govObjectDeserialize = function (hexdata, callback) { + var self = this; + this.client.gobject('deserialize', hexdata, function(err, response) { + if (err) { + return callback(self._wrapRPCError(err)); + } + callback(null, response); + }); +}; + +Dash.prototype.govObjectCheck = function(hexdata, callback){ var self = this; this.client.gobject('check', hexdata, function(err, response) { @@ -2197,9 +2259,40 @@ Bitcoin.prototype.govObjectCheck = function(hexdata, callback){ } callback(null, response); }); -} +}; +Dash.prototype.govObjectInfo = function (callback) { + var self = this; + var result = self.govCache.get('info'); + if(result){ + callback(null, result); + }else{ + this.client.getgovernanceinfo(function(err, response) { + + if (err) { + return callback(self._wrapRPCError(err)); + } + self.govCache.set('info',response); + callback(null, response); + }); + } +}; +Dash.prototype.govCount = function (callback) { + var self = this; + var result = self.govCache.get('count'); + if(result){ + callback(null, result); + }else{ + this.client.gobject('count',function(err, response) { -Bitcoin.prototype.getSpork = function(callback){ + if (err) { + return callback(self._wrapRPCError(err)); + } + self.govCache.set('count',response); + callback(null, response); + }); + } +}; +Dash.prototype.getSpork = function(callback){ var self = this; var SporksList = {}; self.client.spork('show', function(err, response){ @@ -2221,7 +2314,7 @@ Bitcoin.prototype.getSpork = function(callback){ }); }; -Bitcoin.prototype.getMNList = function(callback){ +Dash.prototype.getMNList = function(callback){ var self = this; var rawResults= {}; var MNList = []; @@ -2235,7 +2328,7 @@ Bitcoin.prototype.getMNList = function(callback){ return next(new Error('Blockchain is not synced yet')); } return next(); - }) + }); }; var getRank = function(next){ @@ -2300,27 +2393,8 @@ Bitcoin.prototype.getMNList = function(callback){ } next(); }); - } - //DEACTIVATED because of slow response from dashd - var getLastPaidBlock = function(next){ - self.client.masternodelist('lastpaidblock', function(err, response){ - if(response && response.hasOwnProperty('result')){ - var result = response.result; - rawResults.lastpaidblock=result; - } - next(); - }); - } - //DEACTIVATED because of slow response from dashd - var getLastPaidTime = function(next){ - self.client.masternodelist('lastpaidtime', function(err, response){ - if(response && response.hasOwnProperty('result')){ - var result = response.result; - rawResults.lastpaidtime=result; - } - next(); - }); - } + }; + var prepareResponse = function(err){ if(err){ return callback(self._wrapRPCError(err),null); @@ -2334,7 +2408,7 @@ Bitcoin.prototype.getMNList = function(callback){ keys.indexOf('activeseconds')> -1 && keys.indexOf('addr')> -1 ){ - var rankKeys = Object.keys(rawResults['rank']); + var rankKeys = Object.keys(rawResults.rank); var rankLength = rankKeys.length; //We get threw all vins by rank @@ -2342,14 +2416,14 @@ Bitcoin.prototype.getMNList = function(callback){ var vin = rankKeys[i]; var MN = { vin:vin, - status:rawResults['status'][vin], + status:rawResults.status[vin], rank:i+1, - ip:rawResults['addr'][vin], - protocol:rawResults['protocol'][vin], - payee:rawResults['payee'][vin], - activeseconds:rawResults['activeseconds'][vin], - lastseen:rawResults['lastseen'][vin], - } + ip:rawResults.addr[vin], + protocol:rawResults.protocol[vin], + payee:rawResults.payee[vin], + activeseconds:rawResults.activeseconds[vin], + lastseen:rawResults.lastseen[vin], + }; MNList.push(MN); } }else{ @@ -2357,7 +2431,7 @@ Bitcoin.prototype.getMNList = function(callback){ } self.masternodeListCache.set('', MNList); return callback(null, MNList); - } + }; var MNListData = self.masternodeListCache.get(''); if (MNListData) { return setImmediate(function() { @@ -2384,7 +2458,7 @@ Bitcoin.prototype.getMNList = function(callback){ * @param hash * @param callback */ -Bitcoin.prototype.govObjectHash = function(hash, callback) { +Dash.prototype.govObjectHash = function(hash, callback) { var self = this; this.client.gobject('get', hash, function(err, response) { @@ -2428,7 +2502,7 @@ Bitcoin.prototype.govObjectHash = function(hash, callback) { * @param hexdata * @param callback */ -Bitcoin.prototype.govObjectCheck = function govObjectCheck(hexdata, callback) { +Dash.prototype.govObjectCheck = function govObjectCheck(hexdata, callback) { var self = this; this.client.gobject('check', hexdata, function (err, response) { if (err) { @@ -2442,7 +2516,7 @@ Bitcoin.prototype.govObjectCheck = function govObjectCheck(hexdata, callback) { * Will get the best block hash for the chain. * @param {Function} callback */ -Bitcoin.prototype.getBestBlockHash = function(callback) { +Dash.prototype.getBestBlockHash = function(callback) { var self = this; this.client.getBestBlockHash(function(err, response) { if (err) { @@ -2456,7 +2530,7 @@ Bitcoin.prototype.getBestBlockHash = function(callback) { * Will give the txid and inputIndex that spent an output * @param {Function} callback */ -Bitcoin.prototype.getSpentInfo = function(options, callback) { +Dash.prototype.getSpentInfo = function(options, callback) { var self = this; this.client.getSpentInfo(options, function(err, response) { if (err && err.code === -5) { @@ -2484,7 +2558,7 @@ Bitcoin.prototype.getSpentInfo = function(options, callback) { * } * @param {Function} callback */ -Bitcoin.prototype.getInfo = function(callback) { +Dash.prototype.getInfo = function(callback) { var self = this; this.client.getInfo(function(err, response) { if (err) { @@ -2508,7 +2582,7 @@ Bitcoin.prototype.getInfo = function(callback) { }); }; -Bitcoin.prototype.generateBlock = function(num, callback) { +Dash.prototype.generateBlock = function(num, callback) { var self = this; this.client.generate(num, function(err, response) { if (err) { @@ -2522,7 +2596,7 @@ Bitcoin.prototype.generateBlock = function(num, callback) { * Called by Node to stop the service. * @param {Function} callback */ -Bitcoin.prototype.stop = function(callback) { +Dash.prototype.stop = function(callback) { if (this.spawn && this.spawn.process) { var exited = false; this.spawn.process.once('exit', function(code) { @@ -2549,4 +2623,4 @@ Bitcoin.prototype.stop = function(callback) { } }; -module.exports = Bitcoin; +module.exports = Dash; diff --git a/lib/services/web.js b/lib/services/web.js index d0dd1654d..f42ae5a64 100644 --- a/lib/services/web.js +++ b/lib/services/web.js @@ -9,8 +9,8 @@ var socketio = require('socket.io'); var inherits = require('util').inherits; var BaseService = require('../service'); -var bitcore = require('bitcore-lib-dash'); -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var _ = dashcore.deps._; var index = require('../'); var log = index.log; diff --git a/package-lock.json b/package-lock.json index c49a2c7e6..d94d17931 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,61 @@ { "name": "@dashevo/dashcore-node", - "version": "3.0.6", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@dashevo/dashcore-lib": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/@dashevo/dashcore-lib/-/dashcore-lib-0.15.5.tgz", + "integrity": "sha512-tV5PgQYLMWO3A3I2Q5wN6KKjedlnr1DtFWp1oIufgIKQf3F0bjSWol2+kujy9l7AbeshyO7WHLXvfP8qIJSKjA==", + "requires": { + "@dashevo/x11-hash-js": "^1.0.2", + "bn.js": "=2.0.4", + "bs58": "=2.0.0", + "buffer-compare": "=1.0.0", + "elliptic": "=3.0.3", + "inherits": "=2.0.1", + "lodash": "=4.17.1", + "sha512": "=0.0.1" + } + }, + "@dashevo/dashcore-p2p": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@dashevo/dashcore-p2p/-/dashcore-p2p-1.1.6.tgz", + "integrity": "sha512-ttsoeexBP2oOiMZCSH4ez10r0LYbJMY1QSxKlsHKWPYmo27zFppcmAZGjZMp3JavNbfh0Bms7DNV281d5aKd4A==", + "dev": true, + "requires": { + "bitcore-lib-dash": "^0.15.2", + "bloom-filter": "^0.2.0", + "node-buffers": "^0.1.1", + "socks5-client": "^0.3.6" + } + }, + "@dashevo/dashd-rpc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@dashevo/dashd-rpc/-/dashd-rpc-1.0.1.tgz", + "integrity": "sha512-iltJCCcE/NL82CKb57pSe+bqoMFf0ZjtOfazwWk96n3ko3/OUxKUeH+94ABRADQfX05iQlU5TZvGoAqz6I+oNg==", + "requires": { + "async": "^1.3.0" + } + }, + "@dashevo/x11-hash-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@dashevo/x11-hash-js/-/x11-hash-js-1.0.2.tgz", + "integrity": "sha512-3vvnZweBca4URBXHF+FTrM4sdTpp3IMt73G1zUKQEdYm/kJkIKN94qpFai7YZDl87k64RCH+ckRZk6ruQPz5KQ==" + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true }, "accepts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", - "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "requires": { - "mime-types": "2.1.17", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -29,9 +70,20 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "amdefine": { @@ -52,38 +104,30 @@ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, - "ansicolors": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", - "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=" - }, - "ansistyles": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz", - "integrity": "sha1-XeYEFb2gcbs3EnhUyGT0GyMlRTk=" - }, "argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "requires": { - "arr-flatten": "1.1.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, "array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -100,20 +144,15 @@ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "arraybuffer.slice": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=" }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" - }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -127,30 +166,32 @@ "dev": true }, "assertion-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", - "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, - "async-some": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/async-some/-/async-some-1.0.2.tgz", - "integrity": "sha1-TYqBYg1ZWHkbW5j4AtMgd3bpVQk=", - "requires": { - "dezalgo": "1.0.3" - } - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=" + }, "aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", @@ -158,9 +199,9 @@ "dev": true }, "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", "dev": true }, "backo2": { @@ -171,7 +212,58 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } }, "base64-arraybuffer": { "version": "0.1.5", @@ -190,7 +282,7 @@ "dev": true, "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "beeper": { @@ -218,51 +310,20 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", "integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=" }, - "bitcoind-rpc-dash": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bitcoind-rpc-dash/-/bitcoind-rpc-dash-1.0.1.tgz", - "integrity": "sha512-96H3DAecBZcg7k9VHmwQYzZdkR4h3iNYanG1BZccTlmGFTrj6fct5FgKL65G014Nni/sc12aqDZJ8XtxBtXwBA==", - "requires": { - "async": "1.5.2" - } - }, "bitcore-lib-dash": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/bitcore-lib-dash/-/bitcore-lib-dash-0.15.2.tgz", - "integrity": "sha512-NKoFfFrhp5EKv8MZFjYt1lna/4dUIBtzRpzD0t5Sfpgk3uoXD7VqCCyneSy4icTWYf3tQzVU4Ba9GYeU8QzwxQ==", - "requires": { - "bn.js": "2.0.4", - "bs58": "2.0.0", - "buffer-compare": "1.0.0", - "elliptic": "3.0.3", - "inherits": "2.0.1", - "lodash": "4.17.1", - "sha512": "0.0.1", - "x11-hash-js": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" - }, - "lodash": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.1.tgz", - "integrity": "sha1-516vF6NHMMZJHZlW9NgfOgRPAb8=" - } - } - }, - "bitcore-p2p-dash": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/bitcore-p2p-dash/-/bitcore-p2p-dash-1.1.6.tgz", - "integrity": "sha512-fFtWDhbGWbIQwSx3RYPwKdrPQQsZZHAR3SWEE2a/UopIOkx3hE44a2atQEWLudGtS7FDwemRVE/9tfAWI+qoRA==", + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/bitcore-lib-dash/-/bitcore-lib-dash-0.15.3.tgz", + "integrity": "sha512-G+kq6r2UlroM/Ql8tIAN9YjLggKjJDfr7yYvuUdJ1w2TyXUNZjxYj7pB8REkyCdLgYtoO5tMKTlNWQNgzkxViw==", "dev": true, "requires": { - "bitcore-lib-dash": "0.15.2", - "bloom-filter": "0.2.0", - "node-buffers": "0.1.1", - "socks5-client": "0.3.6" + "bn.js": "=2.0.4", + "bs58": "=2.0.0", + "buffer-compare": "=1.0.0", + "elliptic": "=3.0.3", + "inherits": "=2.0.1", + "lodash": "=4.17.1", + "sha512": "=0.0.1", + "x11-hash-js": "^1.0.0" } }, "blob": { @@ -270,14 +331,6 @@ "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "2.0.3" - } - }, "bloom-filter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bloom-filter/-/bloom-filter-0.2.0.tgz", @@ -290,20 +343,20 @@ "integrity": "sha1-Igp81nf38b+pNif/QZN3b+eBlIA=" }, "body-parser": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.1", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", - "on-finished": "2.3.0", - "qs": "6.5.1", - "raw-body": "2.3.2", - "type-is": "1.6.15" + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" } }, "boom": { @@ -312,26 +365,44 @@ "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "brorand": { @@ -355,25 +426,31 @@ "integrity": "sha1-N75dNuHgZJIiHmjUdLGsWOUQy9c=", "optional": true, "requires": { - "bindings": "1.2.1", - "nan": "2.8.0" + "bindings": "1.2.x", + "nan": "^2.0.5" } }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, - "builtins": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-0.0.7.tgz", - "integrity": "sha1-NVIZzWzxjb58Acx/0tznZc/cVJo=" - }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", @@ -399,8 +476,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chai": { @@ -409,9 +486,9 @@ "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", "dev": true, "requires": { - "assertion-error": "1.0.2", - "deep-eql": "0.1.3", - "type-detect": "1.0.0" + "assertion-error": "^1.0.1", + "deep-eql": "^0.1.3", + "type-detect": "^1.0.0" } }, "chalk": { @@ -420,11 +497,32 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } } }, "cli": { @@ -433,7 +531,7 @@ "integrity": "sha1-ePlIXNFhtWbppsctcXDEJw6B22E=", "dev": true, "requires": { - "glob": "7.1.2" + "glob": ">= 3.1.4" } }, "cliff": { @@ -442,9 +540,9 @@ "integrity": "sha1-U74z6p9ZvshWCe4wCsQgdgPlIBM=", "dev": true, "requires": { - "colors": "1.0.3", - "eyes": "0.1.8", - "winston": "0.8.3" + "colors": "~1.0.3", + "eyes": "~0.1.8", + "winston": "0.8.x" }, "dependencies": { "colors": { @@ -462,8 +560,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -476,24 +574,33 @@ } } }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.0.tgz", + "integrity": "sha512-EDpX3a7wHMWFA7PUHWPHNWqOxIIRSJetuwl0AS5Oi/5FMV8kWm69RTlgm00GKjBO1xFHMtBbL49yRtMMdticBw==" }, "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", - "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==" + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" }, "component-bind": { "version": "1.0.0", @@ -501,9 +608,9 @@ "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" }, "component-emitter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", - "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" }, "component-inherit": { "version": "0.0.3", @@ -513,7 +620,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "console-browserify": { "version": "1.1.0", @@ -521,7 +629,7 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "0.1.4" + "date-now": "^0.1.4" } }, "content-disposition": { @@ -544,6 +652,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -577,7 +690,7 @@ "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "dev": true, "requires": { - "boom": "2.10.1" + "boom": "2.x.x" } }, "cycle": { @@ -592,7 +705,7 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -617,11 +730,6 @@ "ms": "2.0.0" } }, - "debuglog": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=" - }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -629,6 +737,11 @@ "dev": true, "optional": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, "deep-eql": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", @@ -652,6 +765,43 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -659,9 +809,9 @@ "dev": true }, "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, "destroy": { "version": "1.0.4", @@ -669,21 +819,9 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "detect-file": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", - "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", - "requires": { - "fs-exists-sync": "0.1.0" - } - }, - "dezalgo": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", - "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", - "requires": { - "asap": "2.0.6", - "wrappy": "1.0.2" - } + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" }, "diff": { "version": "1.4.0", @@ -697,8 +835,8 @@ "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", "dev": true, "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" + "domelementtype": "~1.1.1", + "entities": "~1.1.1" }, "dependencies": { "domelementtype": { @@ -727,7 +865,7 @@ "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", "dev": true, "requires": { - "domelementtype": "1.3.0" + "domelementtype": "1" } }, "domutils": { @@ -736,8 +874,8 @@ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" } }, "ecc-jsbn": { @@ -747,7 +885,7 @@ "dev": true, "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "ee-first": { @@ -757,31 +895,31 @@ }, "elliptic": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz", + "resolved": "http://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz", "integrity": "sha1-hlybQgv75VAGuflp+XoNLESWZZU=", "requires": { - "bn.js": "2.0.4", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "inherits": "2.0.3" + "bn.js": "^2.0.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" } }, "encodeurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, "engine.io": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.4.tgz", - "integrity": "sha1-d7zhK4Dl1gQpM3/sOw2vaR68kAM=", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.5.tgz", + "integrity": "sha512-j1DWIcktw4hRwrv6nWx++5nFH2X64x16MAG2P0Lmi5Dvdfi3I+Jhc7JKJIdAmDJa+5aZ/imHV7dWRPy2Cqjh3A==", "requires": { "accepts": "1.3.3", "base64id": "1.0.0", "cookie": "0.3.1", "debug": "2.3.3", "engine.io-parser": "1.3.2", - "ws": "1.1.4" + "ws": "~1.1.5" }, "dependencies": { "accepts": { @@ -789,7 +927,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", "requires": { - "mime-types": "2.1.17", + "mime-types": "~2.1.11", "negotiator": "0.6.1" } }, @@ -809,9 +947,9 @@ } }, "engine.io-client": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.4.tgz", - "integrity": "sha1-n+hd7iWFPKa6viW9KtaHEIY+kcI=", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.5.tgz", + "integrity": "sha512-AYTgHyeVUPitsseqjoedjhYJapNVoSPShbZ+tEUX9/73jgZ/Z3sUlJf9oYgdEBBdVhupUpUqSxH0kBCXlQnmZg==", "requires": { "component-emitter": "1.2.1", "component-inherit": "0.0.3", @@ -822,16 +960,11 @@ "parsejson": "0.0.3", "parseqs": "0.0.5", "parseuri": "0.0.5", - "ws": "1.1.2", + "ws": "~1.1.5", "xmlhttprequest-ssl": "1.5.3", "yeast": "0.1.2" }, "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, "debug": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", @@ -844,15 +977,6 @@ "version": "0.7.2", "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" - }, - "ws": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", - "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", - "requires": { - "options": "0.0.6", - "ultron": "1.0.2" - } } } }, @@ -876,11 +1000,11 @@ "dev": true }, "errno": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", - "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "requires": { - "prr": "0.0.0" + "prr": "~1.0.1" } }, "escape-html": { @@ -900,11 +1024,23 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "dependencies": { + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + } } }, "esprima": { @@ -937,75 +1073,152 @@ "dev": true }, "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "requires": { - "fill-range": "2.2.3" + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "expand-tilde": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", - "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "requires": { - "os-homedir": "1.0.2" + "homedir-polyfill": "^1.0.1" } }, "express": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", - "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "requires": { - "accepts": "1.3.4", + "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", - "content-type": "1.0.4", + "content-type": "~1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "1.1.1", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "etag": "1.8.1", - "finalhandler": "1.1.0", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.2", + "proxy-addr": "~2.0.3", "qs": "6.5.1", - "range-parser": "1.2.0", + "range-parser": "~1.2.0", "safe-buffer": "5.1.1", - "send": "0.16.1", - "serve-static": "1.13.1", + "send": "0.16.2", + "serve-static": "1.13.2", "setprototypeof": "1.1.0", - "statuses": "1.3.1", - "type-is": "1.6.15", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", - "vary": "1.1.2" + "vary": "~1.1.2" }, "dependencies": { - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.1", + "http-errors": "~1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "~2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "~1.6.15" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": ">= 1.3.1 < 2" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } }, "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" } } }, @@ -1014,12 +1227,82 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "is-extglob": "1.0.0" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, "extsprintf": { @@ -1040,63 +1323,67 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" - }, "fill-keys": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", "dev": true, "requires": { - "is-object": "1.0.1", - "merge-descriptors": "1.0.1" + "is-object": "~1.0.1", + "merge-descriptors": "~1.0.0" } }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" }, "dependencies": { "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" } } }, "findup-sync": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", - "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "requires": { - "detect-file": "0.1.0", - "is-glob": "2.0.1", - "micromatch": "2.3.11", - "resolve-dir": "0.1.1" + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, "fined": { @@ -1104,27 +1391,17 @@ "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", "requires": { - "expand-tilde": "2.0.2", - "is-plain-object": "2.0.4", - "object.defaults": "1.1.0", - "object.pick": "1.3.0", - "parse-filepath": "1.0.1" - }, - "dependencies": { - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "requires": { - "homedir-polyfill": "1.0.1" - } - } + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" } }, "flagged-respawn": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz", - "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz", + "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=" }, "for-in": { "version": "1.0.2", @@ -1132,11 +1409,11 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" }, "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "forever-agent": { @@ -1151,9 +1428,9 @@ "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "dev": true, "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" } }, "formatio": { @@ -1162,7 +1439,7 @@ "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", "dev": true, "requires": { - "samsam": "1.1.2" + "samsam": "~1.1" } }, "forwarded": { @@ -1170,31 +1447,24 @@ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" + } + }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=" - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.0", - "rimraf": "2.6.2" - } + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "generate-function": { "version": "2.0.0", @@ -1208,16 +1478,21 @@ "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", "dev": true, "requires": { - "is-property": "1.0.2" + "is-property": "^1.0.0" } }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -1228,66 +1503,42 @@ } } }, - "github-url-from-username-repo": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.2.tgz", - "integrity": "sha1-fdeTMNKr5pwQws73lxTJchV5Hfo=" - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "requires": { - "is-glob": "2.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "requires": { - "global-prefix": "0.1.5", - "is-windows": "0.2.0" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "requires": { - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "0.2.0", - "which": "1.3.0" + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, "growl": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", @@ -1300,10 +1551,10 @@ "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "source-map": { @@ -1312,7 +1563,7 @@ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -1323,10 +1574,10 @@ "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", "dev": true, "requires": { - "chalk": "1.1.3", - "commander": "2.12.2", - "is-my-json-valid": "2.16.1", - "pinkie-promise": "2.0.1" + "chalk": "^1.1.1", + "commander": "^2.9.0", + "is-my-json-valid": "^2.12.4", + "pinkie-promise": "^2.0.0" } }, "has-ansi": { @@ -1335,7 +1586,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-binary": { @@ -1364,13 +1615,49 @@ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "hash.js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } } }, "hawk": { @@ -1379,10 +1666,10 @@ "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "dev": true, "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" } }, "hoek": { @@ -1396,36 +1683,38 @@ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", "requires": { - "parse-passwd": "1.0.0" + "parse-passwd": "^1.0.0" } }, - "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" - }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "dev": true, "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" } }, "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "depd": "1.1.1", + "depd": "~1.1.2", "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.4.0" + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } } }, "http-signature": { @@ -1434,20 +1723,18 @@ "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "dev": true, "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } }, "indexof": { "version": "0.0.1", @@ -1458,15 +1745,16 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" }, "ini": { "version": "1.3.5", @@ -1474,9 +1762,9 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "ipaddr.js": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", - "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" }, "ipv6": { "version": "3.1.3", @@ -1484,9 +1772,9 @@ "integrity": "sha1-TZBk+cLa+g3RC4t9dv/KSq0xs7k=", "dev": true, "requires": { - "cli": "0.4.5", - "cliff": "0.1.10", - "sprintf": "0.1.5" + "cli": "0.4.x", + "cliff": "0.1.x", + "sprintf": "0.1.x" } }, "irregular-plurals": { @@ -1496,12 +1784,30 @@ "dev": true }, "is-absolute": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", - "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "is-relative": "0.2.1", - "is-windows": "0.2.0" + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "is-buffer": { @@ -1509,25 +1815,39 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "builtin-modules": "1.1.1" + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-primitive": "2.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } } }, "is-extendable": { @@ -1536,36 +1856,53 @@ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^2.1.0" } }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, "is-my-json-valid": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", "dev": true, "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" + "generate-function": "^2.0.0", + "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", + "jsonpointer": "^4.0.0", + "xtend": "^4.0.0" } }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "is-object": { @@ -1574,30 +1911,28 @@ "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", "dev": true }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", "requires": { - "isobject": "3.0.1" + "is-number": "^4.0.0" }, "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" } } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } }, "is-property": { "version": "1.0.2", @@ -1606,11 +1941,11 @@ "dev": true }, "is-relative": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", - "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "requires": { - "is-unc-path": "0.1.2" + "is-unc-path": "^1.0.0" } }, "is-typedarray": { @@ -1620,17 +1955,17 @@ "dev": true }, "is-unc-path": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", - "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "requires": { - "unc-path-regex": "0.1.2" + "unc-path-regex": "^0.1.2" } }, "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, "isarray": { "version": "1.0.0", @@ -1643,12 +1978,9 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, "isstream": { "version": "0.1.2", @@ -1662,20 +1994,20 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.11", - "js-yaml": "3.6.1", - "mkdirp": "0.5.0", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.3.0", - "wordwrap": "1.0.0" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" }, "dependencies": { "glob": { @@ -1684,11 +2016,11 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "resolve": { @@ -1703,7 +2035,7 @@ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } @@ -1738,8 +2070,8 @@ "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", "dev": true, "requires": { - "argparse": "1.0.9", - "esprima": "2.7.3" + "argparse": "^1.0.7", + "esprima": "^2.6.0" } }, "jsbn": { @@ -1755,14 +2087,14 @@ "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", "dev": true, "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "3.7.x", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" }, "dependencies": { "cli": { @@ -1772,7 +2104,7 @@ "dev": true, "requires": { "exit": "0.1.2", - "glob": "7.1.2" + "glob": "^7.1.1" } }, "lodash": { @@ -1789,19 +2121,14 @@ "integrity": "sha1-JCCCosA1rgP9gQROBXDMQgjPbmE=", "dev": true, "requires": { - "beeper": "1.1.1", - "chalk": "1.1.3", - "log-symbols": "1.0.2", - "plur": "2.1.2", - "string-length": "1.0.1", - "text-table": "0.2.0" + "beeper": "^1.1.0", + "chalk": "^1.0.0", + "log-symbols": "^1.0.0", + "plur": "^2.1.0", + "string-length": "^1.0.0", + "text-table": "^0.2.0" } }, - "json-parse-better-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz", - "integrity": "sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==" - }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -1846,12 +2173,9 @@ } }, "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" }, "lazy-cache": { "version": "1.0.4", @@ -1872,40 +2196,29 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "liftoff": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", - "integrity": "sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U=", - "requires": { - "extend": "3.0.1", - "findup-sync": "0.4.3", - "fined": "1.1.0", - "flagged-respawn": "0.3.2", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.mapvalues": "4.6.0", - "rechoir": "0.6.2", - "resolve": "1.5.0" - } - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", + "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "requires": { + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + } }, - "lodash.mapvalues": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", - "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=" + "lodash": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.1.tgz", + "integrity": "sha1-516vF6NHMMZJHZlW9NgfOgRPAb8=" }, "log-driver": { "version": "1.2.5", @@ -1919,7 +2232,7 @@ "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", "dev": true, "requires": { - "chalk": "1.1.3" + "chalk": "^1.0.0" } }, "lolex": { @@ -1935,12 +2248,20 @@ "dev": true }, "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "kind-of": "^6.0.2" } }, "map-cache": { @@ -1948,6 +2269,14 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1964,23 +2293,23 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "mime": { @@ -1989,29 +2318,30 @@ "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" }, "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "requires": { - "mime-db": "1.30.0" + "mime-db": "~1.33.0" } }, "minimalistic-assert": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -2019,6 +2349,25 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", @@ -2072,8 +2421,8 @@ "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "dev": true, "requires": { - "inherits": "2.0.3", - "minimatch": "0.3.0" + "inherits": "2", + "minimatch": "0.3" } }, "lru-cache": { @@ -2088,8 +2437,8 @@ "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", "dev": true, "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "mkdirp": { @@ -2127,11 +2476,30 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "optional": true }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -2153,1547 +2521,81 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, "requires": { - "abbrev": "1.0.9" + "abbrev": "1" } }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "requires": { - "hosted-git-info": "2.5.0", - "is-builtin-module": "1.0.0", - "semver": "5.4.1", - "validate-npm-package-license": "3.0.1" - } + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, - "npm": { - "version": "2.15.12", - "resolved": "https://registry.npmjs.org/npm/-/npm-2.15.12.tgz", - "integrity": "sha1-33w+1aJ3w/nUtdgZsFMR0QogCuY=", - "requires": { - "abbrev": "1.0.9", - "ansi": "0.3.1", - "ansi-regex": "2.0.0", - "ansicolors": "0.3.2", - "ansistyles": "0.1.3", - "archy": "1.0.0", - "async-some": "1.0.2", - "block-stream": "0.0.9", - "char-spinner": "1.0.1", - "chmodr": "1.0.2", - "chownr": "1.0.1", - "cmd-shim": "2.0.2", - "columnify": "1.5.4", - "config-chain": "1.1.10", - "dezalgo": "1.0.3", - "editor": "1.0.0", - "fs-vacuum": "1.2.9", - "fs-write-stream-atomic": "1.0.8", - "fstream": "1.0.11", - "fstream-npm": "1.1.1", - "github-url-from-git": "1.4.0", - "github-url-from-username-repo": "1.0.2", - "glob": "7.0.6", - "graceful-fs": "4.1.6", - "hosted-git-info": "2.1.5", - "imurmurhash": "0.1.4", - "inflight": "1.0.5", - "inherits": "2.0.3", - "ini": "1.3.4", - "init-package-json": "1.9.4", - "lockfile": "1.0.1", - "lru-cache": "4.0.1", - "minimatch": "3.0.3", - "mkdirp": "0.5.1", - "node-gyp": "3.6.0", - "nopt": "3.0.6", - "normalize-git-url": "3.0.2", - "normalize-package-data": "2.3.5", - "npm-cache-filename": "1.0.2", - "npm-install-checks": "1.0.7", - "npm-package-arg": "4.1.0", - "npm-registry-client": "7.2.1", - "npm-user-validate": "0.1.5", - "npmlog": "2.0.4", - "once": "1.4.0", - "opener": "1.4.1", - "osenv": "0.1.3", - "path-is-inside": "1.0.2", - "read": "1.0.7", - "read-installed": "4.0.3", - "read-package-json": "2.0.4", - "readable-stream": "2.1.5", - "realize-package-specifier": "3.0.1", - "request": "2.74.0", - "retry": "0.10.0", - "rimraf": "2.5.4", - "semver": "5.1.0", - "sha": "2.0.1", - "slide": "1.1.6", - "sorted-object": "2.0.0", - "spdx-license-ids": "1.2.2", - "strip-ansi": "3.0.1", - "tar": "2.2.1", - "text-table": "0.2.0", - "uid-number": "0.0.6", - "umask": "1.1.0", - "validate-npm-package-license": "3.0.1", - "validate-npm-package-name": "2.2.2", - "which": "1.2.11", - "wrappy": "1.0.2", - "write-file-atomic": "1.1.4" + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=" + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" - }, - "ansi": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", - "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=" - }, - "ansi-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "integrity": "sha1-xQYbbg74qBd15Q9dZhUb9r83EQc=" - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "2.0.3" - } - }, - "char-spinner": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz", - "integrity": "sha1-5upnvSR+EHESmDt6sEee02KAAIE=" - }, - "chmodr": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chmodr/-/chmodr-1.0.2.tgz", - "integrity": "sha1-BGYrky0PAuxm3qorDqQoEZaOPrk=" - }, - "chownr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" - }, - "cmd-shim": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz", - "integrity": "sha1-b8vamUg6j9FdfTChlspp1oii79s=", - "requires": { - "graceful-fs": "4.1.6", - "mkdirp": "0.5.1" - } - }, - "columnify": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", - "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", - "requires": { - "strip-ansi": "3.0.1", - "wcwidth": "1.0.0" - }, - "dependencies": { - "wcwidth": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz", - "integrity": "sha1-AtBZ/3qPx0Hg9rXaHmmytA2uym8=", - "requires": { - "defaults": "1.0.3" - }, - "dependencies": { - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "requires": { - "clone": "1.0.2" - }, - "dependencies": { - "clone": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", - "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=" - } - } - } - } - } - } - }, - "config-chain": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz", - "integrity": "sha1-f8OD3g/MhNcRy0Zb0XZXnK1hI0Y=", + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "ini": "1.3.4", - "proto-list": "1.2.4" - }, - "dependencies": { - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" - } + "is-descriptor": "^0.1.0" } }, - "editor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz", - "integrity": "sha1-YMf4e9YrzGqJT6jM1q+3gjok90I=" - }, - "fs-vacuum": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.9.tgz", - "integrity": "sha1-T5AZOrjqAokJlbzU6ARlml02ay0=", + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "graceful-fs": "4.1.6", - "path-is-inside": "1.0.2", - "rimraf": "2.5.4" + "is-buffer": "^1.1.5" } - }, - "fs-write-stream-atomic": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz", - "integrity": "sha1-5Jqt3yiPh9Rv+eiC8hahOrxAd4s=", - "requires": { - "graceful-fs": "4.1.6", - "iferr": "0.1.5", - "imurmurhash": "0.1.4", - "readable-stream": "2.1.5" - }, - "dependencies": { - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" - } - } - }, - "fstream-npm": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.1.tgz", - "integrity": "sha1-a5F122I5qD2CCeIyQmxJTbspaQw=", - "requires": { - "fstream-ignore": "1.0.5", - "inherits": "2.0.3" - }, - "dependencies": { - "fstream-ignore": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", - "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.3" - } - } - } - }, - "github-url-from-git": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz", - "integrity": "sha1-KF5rUggZABveEoZ0cEN55P8D4N4=" - }, - "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.5", - "inherits": "2.0.3", - "minimatch": "3.0.3", - "once": "1.4.0", - "path-is-absolute": "1.0.0" - }, - "dependencies": { - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=" - } - } - }, - "graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha1-UUw4dysxvuLgi+3CGgrrOr9UwZ4=" - }, - "hosted-git-info": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", - "integrity": "sha1-C6gdkNouJas0ozLm7HeTbhWYEYs=" - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" - }, - "inflight": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "integrity": "sha1-2zIEzVqd4ubNiQuFxuL2a89PYgo=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" - }, - "init-package-json": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.4.tgz", - "integrity": "sha1-tAU9C0Dwz4QqQZZpN8s9wPU06FY=", - "requires": { - "glob": "6.0.4", - "npm-package-arg": "4.1.0", - "promzard": "0.3.0", - "read": "1.0.7", - "read-package-json": "2.0.4", - "semver": "5.1.0", - "validate-npm-package-license": "3.0.1", - "validate-npm-package-name": "2.2.2" - }, - "dependencies": { - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "requires": { - "inflight": "1.0.5", - "inherits": "2.0.3", - "minimatch": "3.0.3", - "once": "1.4.0", - "path-is-absolute": "1.0.0" - }, - "dependencies": { - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=" - } - } - }, - "promzard": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", - "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", - "requires": { - "read": "1.0.7" - } - } - } - }, - "lockfile": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz", - "integrity": "sha1-nTU+z+P1TRULtX+J1RdGk1o5xPU=" - }, - "lru-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", - "integrity": "sha1-E0OVXtry432bnn7nJB4nxLn7cr4=", - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.0.0" - }, - "dependencies": { - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "yallist": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", - "integrity": "sha1-MGxUODXwnuGkyyO3vOmrNByRzdQ=" - } - } - }, - "minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", - "requires": { - "brace-expansion": "1.1.6" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - }, - "dependencies": { - "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - } - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } - } - }, - "node-gyp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.0.tgz", - "integrity": "sha1-dHT2OjoFARYd2gtjQfAi8UxCP6Y=", - "requires": { - "fstream": "1.0.11", - "glob": "7.0.6", - "graceful-fs": "4.1.6", - "minimatch": "3.0.3", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "npmlog": "2.0.4", - "osenv": "0.1.3", - "request": "2.74.0", - "rimraf": "2.5.4", - "semver": "5.3.0", - "tar": "2.2.1", - "which": "1.2.11" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" - } - } - }, - "normalize-git-url": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.2.tgz", - "integrity": "sha1-jl8Uvgva7bc+ByADEKpBbCc1D8Q=" - }, - "normalize-package-data": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", - "integrity": "sha1-jZJPFClg4Xd+f/4XBUNjHMfLAt8=", - "requires": { - "hosted-git-info": "2.1.5", - "is-builtin-module": "1.0.0", - "semver": "5.1.0", - "validate-npm-package-license": "3.0.1" - }, - "dependencies": { - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "requires": { - "builtin-modules": "1.1.0" - }, - "dependencies": { - "builtin-modules": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz", - "integrity": "sha1-EFOVX9mUpXRuUl5Kxxe4HK8HSRw=" - } - } - } - } - }, - "npm-cache-filename": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz", - "integrity": "sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE=" - }, - "npm-install-checks": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.7.tgz", - "integrity": "sha1-bZGu2grJaAHx7Xqt7hFqbAoIalc=", - "requires": { - "npmlog": "2.0.4", - "semver": "5.1.0" - } - }, - "npm-package-arg": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.0.tgz", - "integrity": "sha1-LgFfisAHN8uX+ZfJy/BZ9Cp0Un0=", - "requires": { - "hosted-git-info": "2.1.5", - "semver": "5.1.0" - } - }, - "npm-registry-client": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz", - "integrity": "sha1-x5ImawiMwxP4Ul5+NSSGJscj23U=", - "requires": { - "concat-stream": "1.5.2", - "graceful-fs": "4.1.6", - "normalize-package-data": "2.3.5", - "npm-package-arg": "4.1.0", - "npmlog": "2.0.4", - "once": "1.4.0", - "request": "2.74.0", - "retry": "0.10.0", - "semver": "5.1.0", - "slide": "1.1.6" - }, - "dependencies": { - "concat-stream": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - } - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - } - } - }, - "retry": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", - "integrity": "sha1-ZJ4VykCEItmDGBYZNef31lLUNd0=" - } - } - }, - "npm-user-validate": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz", - "integrity": "sha1-UkZdUMLSApSlcSW5lrrtv1bFAEs=" - }, - "npmlog": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", - "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", - "requires": { - "ansi": "0.3.1", - "are-we-there-yet": "1.1.2", - "gauge": "1.2.7" - }, - "dependencies": { - "are-we-there-yet": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", - "integrity": "sha1-gORw6VoIR5T+GJkmLFZnxuiN4bM=", - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.1.5" - }, - "dependencies": { - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - } - } - }, - "gauge": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", - "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", - "requires": { - "ansi": "0.3.1", - "has-unicode": "2.0.0", - "lodash.pad": "4.4.0", - "lodash.padend": "4.5.0", - "lodash.padstart": "4.5.0" - }, - "dependencies": { - "has-unicode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz", - "integrity": "sha1-o82Wwwe6QdVZxaLuQIwSoRxMLsM=" - }, - "lodash._baseslice": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "integrity": "sha1-9c4d+YKUjsr/Y/IjhTQVt7l2NwQ=" - }, - "lodash._basetostring": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "integrity": "sha1-kyfJ3FFYhmt/pLnUL0Y45XZt2d8=" - }, - "lodash.pad": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz", - "integrity": "sha1-+qON8mwKaexQhqgiRslY4VDcsas=", - "requires": { - "lodash._baseslice": "4.0.0", - "lodash._basetostring": "4.12.0", - "lodash.tostring": "4.1.4" - } - }, - "lodash.padend": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz", - "integrity": "sha1-oonpN37i5t6Lp/EfOo6zJgcLdhk=", - "requires": { - "lodash._baseslice": "4.0.0", - "lodash._basetostring": "4.12.0", - "lodash.tostring": "4.1.4" - } - }, - "lodash.padstart": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz", - "integrity": "sha1-PqGQ9nNIQcM2TSedEeBWcmtgp5o=", - "requires": { - "lodash._baseslice": "4.0.0", - "lodash._basetostring": "4.12.0", - "lodash.tostring": "4.1.4" - } - }, - "lodash.tostring": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.4.tgz", - "integrity": "sha1-Vgwn0fjq3eA8LM4Zj+9cAx2CmPs=" - } - } - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" - } - }, - "opener": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.1.tgz", - "integrity": "sha1-iXWQrNGu0zEbcDtYvMtNQ/VvKJU=" - }, - "osenv": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz", - "integrity": "sha1-g88FxtZFj8TVrGNi6jJdkvJ1Qhc=", - "requires": { - "os-homedir": "1.0.0", - "os-tmpdir": "1.0.1" - }, - "dependencies": { - "os-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz", - "integrity": "sha1-43B4vGG1hpBjBTiXJX457BJhtwI=" - }, - "os-tmpdir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz", - "integrity": "sha1-6bQjoe2vR5iCVi6S7XHXdDoHG24=" - } - } - }, - "read": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", - "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", - "requires": { - "mute-stream": "0.0.5" - }, - "dependencies": { - "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=" - } - } - }, - "read-package-json": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.4.tgz", - "integrity": "sha1-Ye0bIlbqQ42ACIlQkL6EuOeZyFM=", - "requires": { - "glob": "6.0.4", - "graceful-fs": "4.1.6", - "json-parse-helpfulerror": "1.0.3", - "normalize-package-data": "2.3.5" - }, - "dependencies": { - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "requires": { - "inflight": "1.0.5", - "inherits": "2.0.3", - "minimatch": "3.0.3", - "once": "1.4.0", - "path-is-absolute": "1.0.0" - }, - "dependencies": { - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=" - } - } - }, - "json-parse-helpfulerror": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", - "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", - "requires": { - "jju": "1.3.0" - }, - "dependencies": { - "jju": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz", - "integrity": "sha1-2t2e8BkkvHKLA/L3l5vb1i96Kqo=" - } - } - } - } - }, - "readable-stream": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", - "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=", - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - }, - "dependencies": { - "buffer-shims": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - } - } - }, - "realize-package-specifier": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-3.0.1.tgz", - "integrity": "sha1-/eMukmRI44+ZM02Vt7CNUeOpjZ8=", - "requires": { - "dezalgo": "1.0.3", - "npm-package-arg": "4.1.0" - } - }, - "request": { - "version": "2.74.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz", - "integrity": "sha1-dpPKdou7DqXIzgjAhKRe+gW4kqs=", - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.4.1", - "bl": "1.1.2", - "caseless": "0.11.0", - "combined-stream": "1.0.5", - "extend": "3.0.0", - "forever-agent": "0.6.1", - "form-data": "1.0.0-rc4", - "har-validator": "2.0.6", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.11", - "node-uuid": "1.4.7", - "oauth-sign": "0.8.2", - "qs": "6.2.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.1", - "tunnel-agent": "0.4.3" - }, - "dependencies": { - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" - }, - "aws4": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz", - "integrity": "sha1-/efVKSRm0jDl7g9OA42d+qsI/GE=" - }, - "bl": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", - "integrity": "sha1-/cqHGplxOqANGeO7ukHER4emU5g=", - "requires": { - "readable-stream": "2.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - } - } - } - } - }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=" - }, - "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", - "requires": { - "delayed-stream": "1.0.0" - }, - "dependencies": { - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - } - } - }, - "extend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "1.0.0-rc4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", - "integrity": "sha1-BaxrwiIntD5EYfSIFhVUaZ1Pi14=", - "requires": { - "async": "1.5.2", - "combined-stream": "1.0.5", - "mime-types": "2.1.11" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - } - } - }, - "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", - "requires": { - "chalk": "1.1.3", - "commander": "2.9.0", - "is-my-json-valid": "2.13.1", - "pinkie-promise": "2.0.1" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "requires": { - "ansi-regex": "2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - } - } - }, - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "requires": { - "graceful-readlink": "1.0.1" - }, - "dependencies": { - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" - } - } - }, - "is-my-json-valid": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz", - "integrity": "sha1-1Vd4qC/rawlj/0vhEdXRaE6JBwc=", - "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "2.0.0", - "xtend": "4.0.1" - }, - "dependencies": { - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=" - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "requires": { - "is-property": "1.0.2" - }, - "dependencies": { - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" - } - } - }, - "jsonpointer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", - "integrity": "sha1-OvHdIP6FRjkQ1GmjheMwF9KgMNk=" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "2.0.4" - }, - "dependencies": { - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - } - } - } - } - }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - }, - "dependencies": { - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "requires": { - "hoek": "2.16.3" - } - }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "requires": { - "boom": "2.10.1" - } - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "requires": { - "hoek": "2.16.3" - } - } - } - }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.3.0", - "sshpk": "1.9.2" - }, - "dependencies": { - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" - }, - "jsprim": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz", - "integrity": "sha1-zi4b74NSBLTzCZkoxgL4tq5hVlA=", - "requires": { - "extsprintf": "1.0.2", - "json-schema": "0.2.2", - "verror": "1.3.6" - }, - "dependencies": { - "extsprintf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=" - }, - "json-schema": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz", - "integrity": "sha1-UDVPGfYDkXxpX3C4Wvp3w7DyNQY=" - }, - "verror": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", - "requires": { - "extsprintf": "1.0.2" - } - } - } - }, - "sshpk": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.9.2.tgz", - "integrity": "sha1-O0E1G7rVw03fS9gRmTfv7jGkZ2U=", - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "dashdash": "1.14.0", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.6", - "jodid25519": "1.0.2", - "jsbn": "0.1.0", - "tweetnacl": "0.13.3" - }, - "dependencies": { - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "dashdash": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.0.tgz", - "integrity": "sha1-KeSGxUGL8PNWA0qZPVFoajPoQUE=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, - "requires": { - "jsbn": "0.1.0" - } - }, - "getpass": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "integrity": "sha1-KD/9n8ElaECHUxHBtg6MQBhxEOY=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "jodid25519": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", - "optional": true, - "requires": { - "jsbn": "0.1.0" - } - }, - "jsbn": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", - "integrity": "sha1-ZQmH2g3XT06/WhE3eiqi0nPpff0=", - "optional": true - }, - "tweetnacl": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz", - "integrity": "sha1-1ii1bzvMPVrnS6nUwacE3vWrS1Y=", - "optional": true - } - } - } - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "mime-types": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", - "integrity": "sha1-wlnEcb2oCKhdbNGTtDCl+uRHOzw=", - "requires": { - "mime-db": "1.23.0" - }, - "dependencies": { - "mime-db": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz", - "integrity": "sha1-oxtAcK2uon1zLqMzdApk0OyaZlk=" - } - } - }, - "node-uuid": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "integrity": "sha1-baWhdmjEs91ZYjvaEc9/pMH2Cm8=" - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" - }, - "qs": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz", - "integrity": "sha1-zgPF/wk1vB2daanxTL0Y5WjWdiU=" - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" - }, - "tough-cookie": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz", - "integrity": "sha1-mcd9+7fYBCSeiimdTLD9gf7wg/0=" - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" - } - } - }, - "retry": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", - "integrity": "sha1-ZJ4VykCEItmDGBYZNef31lLUNd0=" - }, - "rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", - "requires": { - "glob": "7.0.6" - } - }, - "semver": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz", - "integrity": "sha1-hfLPhVBGXE3wAM99hvawVBBqueU=" - }, - "sha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/sha/-/sha-2.0.1.tgz", - "integrity": "sha1-YDCCL70smCOUn49y7WQR7lzyWq4=", - "requires": { - "graceful-fs": "4.1.6", - "readable-stream": "2.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", - "integrity": "sha1-vsgb6ujPRVFovC5bKzH1vPrtmxs=", - "requires": { - "core-util-is": "1.0.1", - "inherits": "2.0.3", - "isarray": "0.0.1", - "process-nextick-args": "1.0.3", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.1" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", - "integrity": "sha1-awcIWu+aPMrG7lO/nT3wwVIaVTg=" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "process-nextick-args": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", - "integrity": "sha1-4nLu2CXV6fTqdNjXOx/jEcO+tjA=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "util-deprecate": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", - "integrity": "sha1-NVaj0TxMaqeYPX4kJUeBlxmbeIE=" - } - } - } - } - }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" - }, - "sorted-object": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sorted-object/-/sorted-object-2.0.0.tgz", - "integrity": "sha1-HP6pgWCQR9gEOAekkKnZmzF/r38=" - }, - "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=" - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.0.0" - } - }, - "uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=" - }, - "umask": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", - "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=" - }, - "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", - "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.2" - }, - "dependencies": { - "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", - "requires": { - "spdx-license-ids": "1.2.2" - } - }, - "spdx-expression-parse": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz", - "integrity": "sha1-1SsUtelnB3FECvIlvLVjEirEUvY=", - "requires": { - "spdx-exceptions": "1.0.4", - "spdx-license-ids": "1.2.2" - }, - "dependencies": { - "spdx-exceptions": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz", - "integrity": "sha1-IguEI5EZrpBFqJLbgag/TOFvgP0=" - } - } - } - } - }, - "which": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.11.tgz", - "integrity": "sha1-yLLu6muMFln6fB3U/aq+lTPcXos=", - "requires": { - "isexe": "1.1.2" - }, - "dependencies": { - "isexe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", - "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=" - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" } } }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true - }, - "object-assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", - "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=" - }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + } }, "object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", "requires": { - "array-each": "1.0.1", - "array-slice": "1.1.0", - "for-own": "1.0.0", - "isobject": "3.0.1" - }, - "dependencies": { - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "requires": { - "for-in": "1.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" } }, "object.pick": { @@ -3701,14 +2603,7 @@ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - } + "isobject": "^3.0.1" } }, "on-finished": { @@ -3723,8 +2618,9 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -3733,8 +2629,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "wordwrap": { @@ -3751,12 +2647,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "options": { @@ -3764,30 +2660,14 @@ "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=" }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, "parse-filepath": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", - "integrity": "sha1-FZ1hVdQ5BNFsEO9piRHaHpGWm3M=", - "requires": { - "is-absolute": "0.2.6", - "map-cache": "0.2.2", - "path-root": "0.1.1" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" } }, "parse-passwd": { @@ -3800,7 +2680,7 @@ "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseqs": { @@ -3808,7 +2688,7 @@ "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseuri": { @@ -3816,7 +2696,7 @@ "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseurl": { @@ -3824,16 +2704,16 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" - }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", @@ -3844,7 +2724,7 @@ "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "requires": { - "path-root-regex": "0.1.2" + "path-root-regex": "^0.1.0" } }, "path-root-regex": { @@ -3869,7 +2749,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkginfo": { @@ -3884,27 +2764,27 @@ "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", "dev": true, "requires": { - "irregular-plurals": "1.4.0" + "irregular-plurals": "^1.0.0" } }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" - }, "proxy-addr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", - "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", + "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", "requires": { - "forwarded": "0.1.2", - "ipaddr.js": "1.5.2" + "forwarded": "~0.1.2", + "ipaddr.js": "1.6.0" } }, "proxyquire": { @@ -3913,9 +2793,9 @@ "integrity": "sha1-AtUUpb7ZhvBMuyCTrxZ0FTX3ntw=", "dev": true, "requires": { - "fill-keys": "1.0.2", - "module-not-found-error": "1.0.1", - "resolve": "1.1.7" + "fill-keys": "^1.0.2", + "module-not-found-error": "^1.0.0", + "resolve": "~1.1.7" }, "dependencies": { "resolve": { @@ -3927,9 +2807,9 @@ } }, "prr": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", - "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, "pseudomap": { "version": "1.0.2", @@ -3943,46 +2823,9 @@ "dev": true }, "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "1.1.6" - } - } - } + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "range-parser": { "version": "1.2.0", @@ -3990,52 +2833,26 @@ "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" }, "raw-body": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", "requires": { "bytes": "3.0.0", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", "unpipe": "1.0.0" } }, - "read-installed": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz", - "integrity": "sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc=", - "requires": { - "debuglog": "1.0.1", - "graceful-fs": "4.1.11", - "read-package-json": "2.0.12", - "readdir-scoped-modules": "1.0.2", - "semver": "5.4.1", - "slide": "1.1.6", - "util-extend": "1.0.3" - } - }, - "read-package-json": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.12.tgz", - "integrity": "sha512-m7/I0+tP6D34EVvSlzCtuVA4D/dHL6OpLcn2e4XVP5X57pCKGUy1JjRSBVKHWpB+vUU91sL85h84qX0MdXzBSw==", - "requires": { - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "json-parse-better-errors": "1.0.1", - "normalize-package-data": "2.4.0", - "slash": "1.0.0" - } - }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" }, "dependencies": { "isarray": { @@ -4046,38 +2863,23 @@ } } }, - "readdir-scoped-modules": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz", - "integrity": "sha1-n6+jfShr5dksuuve4DDcm19AZ0c=", - "requires": { - "debuglog": "1.0.1", - "dezalgo": "1.0.3", - "graceful-fs": "4.1.11", - "once": "1.4.0" - } - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "1.5.0" + "resolve": "^1.1.6" } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { - "is-equal-shallow": "0.1.3" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" - }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", @@ -4094,26 +2896,26 @@ "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", "dev": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.11.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "2.0.6", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "qs": "6.3.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.4.3", - "uuid": "3.1.0" + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.11.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~2.0.6", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "qs": "~6.3.0", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "~0.4.1", + "uuid": "^3.0.0" }, "dependencies": { "qs": { @@ -4125,22 +2927,32 @@ } }, "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "resolve-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", - "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "requires": { - "expand-tilde": "1.2.2", - "global-modules": "0.2.3" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -4148,15 +2960,16 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "safe-buffer": { @@ -4164,6 +2977,19 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "samsam": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.1.2.tgz", @@ -4171,52 +2997,73 @@ "dev": true }, "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" }, "send": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", - "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.1", - "destroy": "1.0.4", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.2", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.3.1" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" } } }, "serve-static": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", - "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "requires": { - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "parseurl": "1.3.2", - "send": "0.16.1" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, "sha512": { "version": "0.0.1", @@ -4244,18 +3091,105 @@ "formatio": "1.1.1", "lolex": "1.3.2", "samsam": "1.1.2", - "util": "0.10.3" + "util": ">=0.10.3 <1" } }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, "sntp": { "version": "1.0.9", @@ -4263,7 +3197,7 @@ "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "dev": true, "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "socket.io": { @@ -4272,7 +3206,7 @@ "integrity": "sha1-L37O3DORvy1cc+KR/iM+bjTU3QA=", "requires": { "debug": "2.3.3", - "engine.io": "1.8.4", + "engine.io": "~1.8.4", "has-binary": "0.1.7", "object-assign": "4.1.0", "socket.io-adapter": "0.5.0", @@ -4328,7 +3262,7 @@ "component-bind": "1.0.0", "component-emitter": "1.2.1", "debug": "2.3.3", - "engine.io-client": "1.8.4", + "engine.io-client": "~1.8.4", "has-binary": "0.1.7", "indexof": "0.0.1", "object-component": "0.0.3", @@ -4337,11 +3271,6 @@ "to-array": "0.1.4" }, "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, "debug": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", @@ -4368,6 +3297,11 @@ "json3": "3.3.2" }, "dependencies": { + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=" + }, "debug": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", @@ -4394,37 +3328,39 @@ "integrity": "sha1-QgW1eR8t93zwdSciJVj+TkasovE=", "dev": true, "requires": { - "ipv6": "3.1.3", - "network-byte-order": "0.2.0" + "ipv6": "~3.1.1", + "network-byte-order": "~0.2.0" } }, "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": "1.0.1" - } + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, - "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "requires": { - "spdx-license-ids": "1.2.2" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=" + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" }, - "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=" + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } }, "sprintf": { "version": "0.1.5", @@ -4439,19 +3375,19 @@ "dev": true }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", - "dev": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" }, "dependencies": { "assert-plus": { @@ -4468,10 +3404,29 @@ "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, "string-length": { "version": "1.0.1", @@ -4479,7 +3434,7 @@ "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", "dev": true, "requires": { - "strip-ansi": "3.0.1" + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -4489,9 +3444,9 @@ "dev": true }, "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", "dev": true }, "strip-ansi": { @@ -4500,7 +3455,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-json-comments": { @@ -4515,20 +3470,11 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "to-array": { "version": "0.1.4", @@ -4541,13 +3487,51 @@ "integrity": "sha1-TcGeZk38y+Jb2NtQiwDG2hWCVdE=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "tunnel-agent": { @@ -4569,7 +3553,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -4579,12 +3563,12 @@ "dev": true }, "type-is": { - "version": "1.6.15", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", - "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.17" + "mime-types": "~2.1.18" } }, "uglify-js": { @@ -4594,18 +3578,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "optional": true - } + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" } }, "uglify-to-browserify": { @@ -4625,19 +3600,100 @@ "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "requires": { + "kind-of": "^6.0.2" + } + }, "utf-8-validate": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-1.2.2.tgz", "integrity": "sha1-i7hxpHQeCFxwSHynrNvX1tNgKes=", "optional": true, "requires": { - "bindings": "1.2.1", - "nan": "2.4.0" + "bindings": "~1.2.1", + "nan": "~2.4.0" }, "dependencies": { "nan": { @@ -4655,49 +3711,19 @@ "dev": true, "requires": { "inherits": "2.0.1" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - } } }, - "util-extend": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=" - }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", - "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" - } - }, - "validate-npm-package-name": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-2.2.2.tgz", - "integrity": "sha1-9laVsi9zJEQgGaPH+jmm5/0pkIU=", - "requires": { - "builtins": "0.0.7" - } - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -4709,9 +3735,9 @@ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" }, "dependencies": { "assert-plus": { @@ -4723,11 +3749,11 @@ } }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "window-size": { @@ -4743,13 +3769,13 @@ "integrity": "sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA=", "dev": true, "requires": { - "async": "0.2.10", - "colors": "0.6.2", - "cycle": "1.0.3", - "eyes": "0.1.8", - "isstream": "0.1.2", - "pkginfo": "0.3.1", - "stack-trace": "0.0.10" + "async": "0.2.x", + "colors": "0.6.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "pkginfo": "0.3.x", + "stack-trace": "0.0.x" }, "dependencies": { "async": { @@ -4775,25 +3801,16 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write-file-atomic": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz", - "integrity": "sha1-sfUtwujcDjywTRh6JfdYo4qQyjs=", - "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" - } + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "ws": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.4.tgz", - "integrity": "sha1-V/QNA2gy5fUFVmKjl8Tedu1mv2E=", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", "requires": { - "options": "0.0.6", - "ultron": "1.0.2" + "options": ">=0.0.5", + "ultron": "1.0.x" } }, "wtf-8": { @@ -4802,9 +3819,10 @@ "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=" }, "x11-hash-js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/x11-hash-js/-/x11-hash-js-1.0.0.tgz", - "integrity": "sha1-hYn83+ezXbM/KDk5U7He+AzzTd4=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/x11-hash-js/-/x11-hash-js-1.0.1.tgz", + "integrity": "sha512-Q1YtSExF+XvO6xUoNvzBDnGhCFZKzc2bPPxIl/uJef/TTP+OdQo1QTRxVuAdJ7CBTVKh7a7RStGP1HHnrxOShQ==", + "dev": true }, "xmlhttprequest-ssl": { "version": "1.5.3", @@ -4829,9 +3847,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } }, @@ -4845,8 +3863,8 @@ "resolved": "https://registry.npmjs.org/zmq/-/zmq-2.15.3.tgz", "integrity": "sha1-Zsbegsw2sJc0uCBwN3ZJCm+75iQ=", "requires": { - "bindings": "1.2.1", - "nan": "2.3.5" + "bindings": "~1.2.1", + "nan": "~2.3.0" }, "dependencies": { "nan": { diff --git a/package.json b/package.json index 701cb0ffa..c56aa0686 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@dashevo/dashcore-node", "description": "Full node with extended capabilities using Dashcore and Dash Core (dashd)", "author": "BitPay ", - "version": "3.0.6", + "version": "4.0.0", "main": "./index.js", "repository": "git://github.com/dashevo/dashcore-node.git", "homepage": "https://github.com/dashevo/dashcore-node", @@ -27,25 +27,25 @@ } ], "bin": { - "bitcore-node-dash": "./bin/dashcore-node" + "dashcore-node": "./bin/dashcore-node" }, "scripts": { "test": "mocha -R spec --recursive", - "regtest": "./scripts/regtest", + "regtest": "./regtest/regtest", "jshint": "jshint --reporter=node_modules/jshint-stylish ./lib", "coverage": "istanbul cover _mocha -- --recursive", "coveralls": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", "mocha": "./node_modules/.bin/mocha", - "bitcoind_test": "./node_modules/.bin/mocha test/services/bitcoind.unit.js" + "dashd_test": "./node_modules/.bin/mocha test/services/dashd.unit.js" }, "tags": [ "dash", "dashd" ], "dependencies": { + "@dashevo/dashcore-lib": "^0.15.5", + "@dashevo/dashd-rpc": "^1.0.1", "async": "^1.3.0", - "bitcoind-rpc-dash": "^1.0.1", - "bitcore-lib-dash": "^0.15.2", "body-parser": "^1.13.3", "colors": "^1.1.2", "commander": "^2.8.1", @@ -54,7 +54,6 @@ "liftoff": "^2.2.0", "lru-cache": "^4.0.1", "mkdirp": "0.5.0", - "npm": "^2.14.1", "path-is-absolute": "^1.0.0", "semver": "^5.0.1", "socket.io": "^1.4.5", @@ -67,7 +66,7 @@ }, "devDependencies": { "benchmark": "1.0.0", - "bitcore-p2p-dash": "^1.1.6", + "@dashevo/dashcore-p2p": "^1.1.6", "chai": "^3.5.0", "coveralls": "^2.11.9", "istanbul": "^0.4.3", diff --git a/regtest/cluster.js b/regtest/cluster.js index 0f6c1aada..5403e80e8 100755 --- a/regtest/cluster.js +++ b/regtest/cluster.js @@ -4,27 +4,27 @@ var path = require('path'); var async = require('async'); var spawn = require('child_process').spawn; -var BitcoinRPC = require('bitcoind-rpc-dash'); +var DashdRPC = require('@dashevo/dashd-rpc'); var rimraf = require('rimraf'); -var bitcore = require('bitcore-lib-dash'); +var dashcore = require('@dashevo/dashcore-lib'); var chai = require('chai'); var should = chai.should(); var index = require('..'); var log = index.log; log.debug = function() {}; -var BitcoreNode = index.Node; -var BitcoinService = index.services.Bitcoin; +var DashcoreNode = index.Node; +var DashService = index.services.Dash; -describe('Bitcoin Cluster', function() { +describe('Dash Cluster', function() { var node; var daemons = []; - var execPath = path.resolve(__dirname, process.env.HOME, './.bitcore/data/dashd') + var execPath = path.resolve(__dirname, process.env.HOME, './.dashcore/data/dashd') var nodesConf = [ { datadir: path.resolve(__dirname, './data/node1'), conf: path.resolve(__dirname, './data/node1/dash.conf'), - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', rpcport: 30521, zmqpubrawtx: 'tcp://127.0.0.1:30611', @@ -33,7 +33,7 @@ describe('Bitcoin Cluster', function() { { datadir: path.resolve(__dirname, './data/node2'), conf: path.resolve(__dirname, './data/node2/dash.conf'), - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', rpcport: 30522, zmqpubrawtx: 'tcp://127.0.0.1:30622', @@ -42,7 +42,7 @@ describe('Bitcoin Cluster', function() { { datadir: path.resolve(__dirname, './data/node3'), conf: path.resolve(__dirname, './data/node3/dash.conf'), - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', rpcport: 30523, zmqpubrawtx: 'tcp://127.0.0.1:30633', @@ -67,7 +67,7 @@ describe('Bitcoin Cluster', function() { var process = spawn(execPath, opts, {stdio: 'inherit'}); - var client = new BitcoinRPC({ + var client = new DashdRPC({ protocol: 'http', host: '127.0.0.1', port: nodeConf.rpcport, @@ -96,34 +96,34 @@ describe('Bitcoin Cluster', function() { }, 1000); }); - it('step 1: will connect to three bitcoind daemons', function(done) { + it('step 1: will connect to three dashd daemons', function(done) { this.timeout(20000); var configuration = { network: 'regtest', services: [ { - name: 'bitcoind', - module: BitcoinService, + name: 'dashd', + module: DashService, config: { connect: [ { rpchost: '127.0.0.1', rpcport: 30521, - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', zmqpubrawtx: 'tcp://127.0.0.1:30611' }, { rpchost: '127.0.0.1', rpcport: 30522, - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', zmqpubrawtx: 'tcp://127.0.0.1:30622' }, { rpchost: '127.0.0.1', rpcport: 30523, - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', zmqpubrawtx: 'tcp://127.0.0.1:30633' } @@ -133,10 +133,10 @@ describe('Bitcoin Cluster', function() { ] }; - var regtest = bitcore.Networks.get('regtest'); + var regtest = dashcore.Networks.get('regtest'); should.exist(regtest); - node = new BitcoreNode(configuration); + node = new DashcoreNode(configuration); node.on('error', function(err) { log.error(err); @@ -156,7 +156,7 @@ describe('Bitcoin Cluster', function() { it('step 2: receive block events', function(done) { this.timeout(10000); - node.services.bitcoind.once('tip', function(height) { + node.services.dashd.once('tip', function(height) { height.should.equal(1); done(); }); diff --git a/regtest/bitcoind.js b/regtest/dashd.js similarity index 81% rename from regtest/bitcoind.js rename to regtest/dashd.js index a0b705ef7..3bcf8e084 100755 --- a/regtest/bitcoind.js +++ b/regtest/dashd.js @@ -1,39 +1,39 @@ 'use strict'; -// To run the tests: $ mocha -R spec regtest/bitcoind.js +// To run the tests: $ mocha -R spec regtest/dashd.js var path = require('path'); var index = require('..'); var log = index.log; var chai = require('chai'); -var bitcore = require('bitcore-lib-dash'); -var BN = bitcore.crypto.BN; +var dashcore = require('@dashevo/dashcore-lib'); +var BN = dashcore.crypto.BN; var async = require('async'); var rimraf = require('rimraf'); -var bitcoind; +var dashd; /* jshint unused: false */ var should = chai.should(); var assert = chai.assert; var sinon = require('sinon'); -var BitcoinRPC = require('bitcoind-rpc-dash'); +var DashdRPC = require('@dashevo/dashd-rpc'); var transactionData = []; var blockHashes = []; var utxos; var client; var coinbasePrivateKey; -var privateKey = bitcore.PrivateKey(); -var destKey = bitcore.PrivateKey(); +var privateKey = dashcore.PrivateKey(); +var destKey = dashcore.PrivateKey(); -describe('Bitcoind Functionality', function() { +describe('Dashd Functionality', function() { before(function(done) { this.timeout(200000); // Add the regtest network - bitcore.Networks.enableRegtest(); - var regtestNetwork = bitcore.Networks.get('regtest'); + dashcore.Networks.enableRegtest(); + var regtestNetwork = dashcore.Networks.get('regtest'); var datadir = __dirname + '/data'; @@ -43,10 +43,10 @@ describe('Bitcoind Functionality', function() { throw err; } - bitcoind = require('../').services.Bitcoin({ + dashd = require('../').services.Dash({ spawn: { datadir: datadir, - exec: path.resolve(__dirname, process.env.HOME, './.bitcore/data/dashd') + exec: path.resolve(__dirname, process.env.HOME, './.dashcore/data/dashd') }, node: { network: regtestNetwork, @@ -56,20 +56,20 @@ describe('Bitcoind Functionality', function() { } }); - bitcoind.on('error', function(err) { + dashd.on('error', function(err) { log.error('error="%s"', err.message); }); - log.info('Waiting for Bitcoin Core to initialize...'); + log.info('Waiting for Dash Core to initialize...'); - bitcoind.start(function() { - log.info('Bitcoind started'); + dashd.start(function() { + log.info('Dashd started'); - client = new BitcoinRPC({ + client = new DashdRPC({ protocol: 'http', host: '127.0.0.1', port: 30331, - user: 'bitcoin', + user: 'dash', pass: 'local321', rejectUnauthorized: false }); @@ -131,8 +131,8 @@ describe('Bitcoind Functionality', function() { after(function(done) { this.timeout(60000); - bitcoind.node.stopping = true; - bitcoind.stop(function(err, result) { + dashd.node.stopping = true; + dashd.stop(function(err, result) { done(); }); }); @@ -141,7 +141,7 @@ describe('Bitcoind Functionality', function() { [0,1,2,3,5,6,7,8,9].forEach(function(i) { it('generated block ' + i, function(done) { - bitcoind.getBlock(blockHashes[i], function(err, block) { + dashd.getBlock(blockHashes[i], function(err, block) { if (err) { throw err; } @@ -156,7 +156,7 @@ describe('Bitcoind Functionality', function() { describe('get blocks as buffers', function() { [0,1,2,3,5,6,7,8,9].forEach(function(i) { it('generated block ' + i, function(done) { - bitcoind.getRawBlock(blockHashes[i], function(err, block) { + dashd.getRawBlock(blockHashes[i], function(err, block) { if (err) { throw err; } @@ -170,8 +170,8 @@ describe('Bitcoind Functionality', function() { describe('get errors as error instances', function() { it('will wrap an rpc into a javascript error', function(done) { - bitcoind.client.getBlock(1000000000, function(err, response) { - var error = bitcoind._wrapRPCError(err); + dashd.client.getBlock(1000000000, function(err, response) { + var error = dashd._wrapRPCError(err); (error instanceof Error).should.equal(true); error.message.should.equal(err.message); error.code.should.equal(err.code); @@ -187,7 +187,7 @@ describe('Bitcoind Functionality', function() { it('generated block ' + i, function(done) { // add the genesis block var height = i + 1; - bitcoind.getBlock(i + 1, function(err, block) { + dashd.getBlock(i + 1, function(err, block) { if (err) { throw err; } @@ -199,7 +199,7 @@ describe('Bitcoind Functionality', function() { }); it('will get error with number greater than tip', function(done) { - bitcoind.getBlock(1000000000, function(err, response) { + dashd.getBlock(1000000000, function(err, response) { should.exist(err); err.code.should.equal(-8); done(); @@ -212,9 +212,9 @@ describe('Bitcoind Functionality', function() { [0,1,2,3,4,5,6,7,8,9].forEach(function(i) { it('for tx ' + i, function(done) { var txhex = transactionData[i]; - var tx = new bitcore.Transaction(); + var tx = new dashcore.Transaction(); tx.fromString(txhex); - bitcoind.getTransaction(tx.hash, function(err, response) { + dashd.getTransaction(tx.hash, function(err, response) { if (err) { throw err; } @@ -226,7 +226,7 @@ describe('Bitcoind Functionality', function() { it('will return error if the transaction does not exist', function(done) { var txid = '6226c407d0e9705bdd7158e60983e37d0f5d23529086d6672b07d9238d5aa618'; - bitcoind.getTransaction(txid, function(err, response) { + dashd.getTransaction(txid, function(err, response) { should.exist(err); done(); }); @@ -237,9 +237,9 @@ describe('Bitcoind Functionality', function() { [0,1,2,3,4,5,6,7,8,9].forEach(function(i) { it('for tx ' + i, function(done) { var txhex = transactionData[i]; - var tx = new bitcore.Transaction(); + var tx = new dashcore.Transaction(); tx.fromString(txhex); - bitcoind.getRawTransaction(tx.hash, function(err, response) { + dashd.getRawTransaction(tx.hash, function(err, response) { if (err) { throw err; } @@ -252,7 +252,7 @@ describe('Bitcoind Functionality', function() { it('will return error if the transaction does not exist', function(done) { var txid = '6226c407d0e9705bdd7158e60983e37d0f5d23529086d6672b07d9238d5aa618'; - bitcoind.getRawTransaction(txid, function(err, response) { + dashd.getRawTransaction(txid, function(err, response) { should.exist(err); done(); }); @@ -263,7 +263,7 @@ describe('Bitcoind Functionality', function() { var expectedWork = new BN(6); [1,2,3,4,5,6,7,8,9].forEach(function(i) { it('generate block ' + i, function(done) { - bitcoind.getBlockHeader(blockHashes[i], function(err, blockIndex) { + dashd.getBlockHeader(blockHashes[i], function(err, blockIndex) { if (err) { return done(err); } @@ -281,7 +281,7 @@ describe('Bitcoind Functionality', function() { }); }); it('will get null prevHash for the genesis block', function(done) { - bitcoind.getBlockHeader(0, function(err, header) { + dashd.getBlockHeader(0, function(err, header) { if (err) { return done(err); } @@ -291,7 +291,7 @@ describe('Bitcoind Functionality', function() { }); }); it('will get error for block not found', function(done) { - bitcoind.getBlockHeader('notahash', function(err, header) { + dashd.getBlockHeader('notahash', function(err, header) { should.exist(err); done(); }); @@ -302,7 +302,7 @@ describe('Bitcoind Functionality', function() { var expectedWork = new BN(6); [2,3,4,5,6,7,8,9].forEach(function(i) { it('generate block ' + i, function() { - bitcoind.getBlockHeader(i, function(err, header) { + dashd.getBlockHeader(i, function(err, header) { should.exist(header); should.exist(header.chainWork); var work = new BN(header.chainWork, 'hex'); @@ -316,7 +316,7 @@ describe('Bitcoind Functionality', function() { }); }); it('will get error with number greater than tip', function(done) { - bitcoind.getBlockHeader(100000, function(err, header) { + dashd.getBlockHeader(100000, function(err, header) { should.exist(err); done(); }); @@ -328,14 +328,14 @@ describe('Bitcoind Functionality', function() { it('will not error and return the transaction hash', function(done) { // create and sign the transaction - var tx = bitcore.Transaction(); + var tx = dashcore.Transaction(); tx.from(utxos[0]); tx.change(privateKey.toAddress()); tx.to(destKey.toAddress(), utxos[0].amount * 1e8 - 1000); - tx.sign(bitcore.PrivateKey.fromWIF(utxos[0].privateKeyWIF)); + tx.sign(dashcore.PrivateKey.fromWIF(utxos[0].privateKeyWIF)); // test sending the transaction - bitcoind.sendTransaction(tx.serialize(), function(err, hash) { + dashd.sendTransaction(tx.serialize(), function(err, hash) { if (err) { return done(err); } @@ -346,11 +346,11 @@ describe('Bitcoind Functionality', function() { }); it('will throw an error if an unsigned transaction is sent', function(done) { - var tx = bitcore.Transaction(); + var tx = dashcore.Transaction(); tx.from(utxos[1]); tx.change(privateKey.toAddress()); tx.to(destKey.toAddress(), utxos[1].amount * 1e8 - 1000); - bitcoind.sendTransaction(tx.uncheckedSerialize(), function(err, hash) { + dashd.sendTransaction(tx.uncheckedSerialize(), function(err, hash) { should.exist(err); (err instanceof Error).should.equal(true); should.not.exist(hash); @@ -360,11 +360,11 @@ describe('Bitcoind Functionality', function() { it('will throw an error for unexpected types (tx decode failed)', function(done) { var garbage = new Buffer('abcdef', 'hex'); - bitcoind.sendTransaction(garbage, function(err, hash) { + dashd.sendTransaction(garbage, function(err, hash) { should.exist(err); should.not.exist(hash); var num = 23; - bitcoind.sendTransaction(num, function(err, hash) { + dashd.sendTransaction(num, function(err, hash) { should.exist(err); (err instanceof Error).should.equal(true); should.not.exist(hash); @@ -374,19 +374,19 @@ describe('Bitcoind Functionality', function() { }); it('will emit "tx" events', function(done) { - var tx = bitcore.Transaction(); + var tx = dashcore.Transaction(); tx.from(utxos[2]); tx.change(privateKey.toAddress()); tx.to(destKey.toAddress(), utxos[2].amount * 1e8 - 1000); - tx.sign(bitcore.PrivateKey.fromWIF(utxos[2].privateKeyWIF)); + tx.sign(dashcore.PrivateKey.fromWIF(utxos[2].privateKeyWIF)); var serialized = tx.serialize(); - bitcoind.once('tx', function(buffer) { + dashd.once('tx', function(buffer) { buffer.toString('hex').should.equal(serialized); done(); }); - bitcoind.sendTransaction(serialized, function(err, hash) { + dashd.sendTransaction(serialized, function(err, hash) { if (err) { return done(err); } @@ -398,7 +398,7 @@ describe('Bitcoind Functionality', function() { describe('fee estimation', function() { it('will estimate fees', function(done) { - bitcoind.estimateFee(1, function(err, fees) { + dashd.estimateFee(1, function(err, fees) { if (err) { return done(err); } @@ -411,7 +411,7 @@ describe('Bitcoind Functionality', function() { describe('tip updates', function() { it('will get an event when the tip is new', function(done) { this.timeout(4000); - bitcoind.on('tip', function(height) { + dashd.on('tip', function(height) { if (height === 151) { done(); } @@ -426,7 +426,7 @@ describe('Bitcoind Functionality', function() { describe('get detailed transaction', function() { it('should include details for coinbase tx', function(done) { - bitcoind.getDetailedTransaction(utxos[0].txid, function(err, tx) { + dashd.getDetailedTransaction(utxos[0].txid, function(err, tx) { if (err) { return done(err); } @@ -464,7 +464,7 @@ describe('Bitcoind Functionality', function() { describe('#getInfo', function() { it('will get information', function(done) { - bitcoind.getInfo(function(err, info) { + dashd.getInfo(function(err, info) { if (err) { return done(err); } diff --git a/regtest/data/dash.conf b/regtest/data/dash.conf index 87b5653d5..1e8c5acb0 100644 --- a/regtest/data/dash.conf +++ b/regtest/data/dash.conf @@ -9,5 +9,5 @@ zmqpubrawtxlock=tcp://127.0.0.1:30332 zmqpubhashblock=tcp://127.0.0.1:30332 rpcallowip=127.0.0.1 rpcport=30331 -rpcuser=bitcoin +rpcuser=dash rpcpassword=local321 diff --git a/regtest/data/node1/dash.conf b/regtest/data/node1/dash.conf index 7d6dc2dba..0ed7164c6 100644 --- a/regtest/data/node1/dash.conf +++ b/regtest/data/node1/dash.conf @@ -12,6 +12,6 @@ zmqpubrawtx=tcp://127.0.0.1:30611 zmqpubrawtxlock=tcp://127.0.0.1:30611 zmqpubhashblock=tcp://127.0.0.1:30611 rpcallowip=127.0.0.1 -rpcuser=bitcoin +rpcuser=dash rpcpassword=local321 keypool=3 diff --git a/regtest/data/node2/dash.conf b/regtest/data/node2/dash.conf index ee3b4c755..2f6615b44 100644 --- a/regtest/data/node2/dash.conf +++ b/regtest/data/node2/dash.conf @@ -12,6 +12,6 @@ zmqpubrawtx=tcp://127.0.0.1:30622 zmqpubrawtxlock=tcp://127.0.0.1:30622 zmqpubhashblock=tcp://127.0.0.1:30622 rpcallowip=127.0.0.1 -rpcuser=bitcoin +rpcuser=dash rpcpassword=local321 keypool=3 diff --git a/regtest/data/node3/dash.conf b/regtest/data/node3/dash.conf index 0d868fa68..1fd52d183 100644 --- a/regtest/data/node3/dash.conf +++ b/regtest/data/node3/dash.conf @@ -12,6 +12,6 @@ zmqpubrawtx=tcp://127.0.0.1:30633 zmqpubrawtxlock=tcp://127.0.0.1:30633 zmqpubhashblock=tcp://127.0.0.1:30633 rpcallowip=127.0.0.1 -rpcuser=bitcoin +rpcuser=dash rpcpassword=local321 keypool=3 diff --git a/regtest/node.js b/regtest/node.js index 12bb4970c..c4c75a313 100644 --- a/regtest/node.js +++ b/regtest/node.js @@ -9,17 +9,17 @@ var log = index.log; log.debug = function() {}; var chai = require('chai'); -var bitcore = require('bitcore-lib-dash'); +var dashcore = require('@dashevo/dashcore-lib'); var rimraf = require('rimraf'); var node; var should = chai.should(); -var BitcoinRPC = require('bitcoind-rpc-dash'); +var DashdRPC = require('@dashevo/dashd-rpc'); var index = require('..'); -var Transaction = bitcore.Transaction; -var BitcoreNode = index.Node; -var BitcoinService = index.services.Bitcoin; +var Transaction = dashcore.Transaction; +var DashcoreNode = index.Node; +var DashService = index.services.Dash; var testWIF = 'cSdkPxkAjA4HDr5VHgsebAPDEh9Gyub4HK8UJr2DFGGqKKy4K5sG'; var testKey; var client; @@ -36,7 +36,7 @@ describe('Node Functionality', function() { var datadir = __dirname + '/data'; - testKey = bitcore.PrivateKey(testWIF); + testKey = dashcore.PrivateKey(testWIF); rimraf(datadir + '/regtest', function(err) { @@ -48,21 +48,21 @@ describe('Node Functionality', function() { network: 'regtest', services: [ { - name: 'bitcoind', - module: BitcoinService, + name: 'dashd', + module: DashService, config: { spawn: { datadir: datadir, - exec: path.resolve(__dirname, process.env.HOME, './.bitcore/data/dashd') + exec: path.resolve(__dirname, process.env.HOME, './.dashcore/data/dashd') } } } ] }; - node = new BitcoreNode(configuration); + node = new DashcoreNode(configuration); - regtest = bitcore.Networks.get('regtest'); + regtest = dashcore.Networks.get('regtest'); should.exist(regtest); node.on('error', function(err) { @@ -74,23 +74,23 @@ describe('Node Functionality', function() { return done(err); } - client = new BitcoinRPC({ + client = new DashdRPC({ protocol: 'http', host: '127.0.0.1', port: 30331, - user: 'bitcoin', + user: 'dash', pass: 'local321', rejectUnauthorized: false }); var syncedHandler = function() { - if (node.services.bitcoind.height === 150) { - node.services.bitcoind.removeListener('synced', syncedHandler); + if (node.services.dashd.height === 150) { + node.services.dashd.removeListener('synced', syncedHandler); done(); } }; - node.services.bitcoind.on('synced', syncedHandler); + node.services.dashd.on('synced', syncedHandler); client.generate(150, function(err) { if (err) { @@ -119,9 +119,9 @@ describe('Node Functionality', function() { var bus = node.openBus(); var blockExpected; var blockReceived; - bus.subscribe('bitcoind/hashblock'); - bus.on('bitcoind/hashblock', function(data) { - bus.unsubscribe('bitcoind/hashblock'); + bus.subscribe('dashd/hashblock'); + bus.on('dashd/hashblock', function(data) { + bus.unsubscribe('dashd/hashblock'); if (blockExpected) { data.should.be.equal(blockExpected); done(); @@ -149,8 +149,8 @@ describe('Node Functionality', function() { before(function(done) { this.timeout(300000); address = testKey.toAddress(regtest).toString(); - var startHeight = node.services.bitcoind.height; - node.services.bitcoind.on('tip', function(height) { + var startHeight = node.services.dashd.height; + node.services.dashd.on('tip', function(height) { if (height === startHeight + 3) { done(); } @@ -248,26 +248,26 @@ describe('Node Functionality', function() { /* jshint maxstatements: 50 */ // Finished once all blocks have been mined - var startHeight = node.services.bitcoind.height; - node.services.bitcoind.on('tip', function(height) { + var startHeight = node.services.dashd.height; + node.services.dashd.on('tip', function(height) { if (height === startHeight + 5) { done(); } }); - testKey2 = bitcore.PrivateKey.fromWIF('cNfF4jXiLHQnFRsxaJyr2YSGcmtNYvxQYSakNhuDGxpkSzAwn95x'); + testKey2 = dashcore.PrivateKey.fromWIF('cNfF4jXiLHQnFRsxaJyr2YSGcmtNYvxQYSakNhuDGxpkSzAwn95x'); address2 = testKey2.toAddress(regtest).toString(); - testKey3 = bitcore.PrivateKey.fromWIF('cVTYQbaFNetiZcvxzXcVMin89uMLC43pEBMy2etgZHbPPxH5obYt'); + testKey3 = dashcore.PrivateKey.fromWIF('cVTYQbaFNetiZcvxzXcVMin89uMLC43pEBMy2etgZHbPPxH5obYt'); address3 = testKey3.toAddress(regtest).toString(); - testKey4 = bitcore.PrivateKey.fromWIF('cPNQmfE31H2oCUFqaHpfSqjDibkt7XoT2vydLJLDHNTvcddCesGw'); + testKey4 = dashcore.PrivateKey.fromWIF('cPNQmfE31H2oCUFqaHpfSqjDibkt7XoT2vydLJLDHNTvcddCesGw'); address4 = testKey4.toAddress(regtest).toString(); - testKey5 = bitcore.PrivateKey.fromWIF('cVrzm9gCmnzwEVMGeCxY6xLVPdG3XWW97kwkFH3H3v722nb99QBF'); + testKey5 = dashcore.PrivateKey.fromWIF('cVrzm9gCmnzwEVMGeCxY6xLVPdG3XWW97kwkFH3H3v722nb99QBF'); address5 = testKey5.toAddress(regtest).toString(); - testKey6 = bitcore.PrivateKey.fromWIF('cPfMesNR2gsQEK69a6xe7qE44CZEZavgMUak5hQ74XDgsRmmGBYF'); + testKey6 = dashcore.PrivateKey.fromWIF('cPfMesNR2gsQEK69a6xe7qE44CZEZavgMUak5hQ74XDgsRmmGBYF'); address6 = testKey6.toAddress(regtest).toString(); var tx = new Transaction(); @@ -660,14 +660,14 @@ describe('Node Functionality', function() { }); it('will update the mempool index after new tx', function(done) { - var memAddress = bitcore.PrivateKey().toAddress(node.network).toString(); + var memAddress = dashcore.PrivateKey().toAddress(node.network).toString(); var tx = new Transaction(); tx.from(unspentOutput); tx.to(memAddress, unspentOutput.satoshis - 2000); tx.fee(2000); tx.sign(testKey); - node.services.bitcoind.sendTransaction(tx.serialize(), function(err, hash) { + node.services.dashd.sendTransaction(tx.serialize(), function(err, hash) { node.getAddressTxids(memAddress, {}, function(err, txids) { if (err) { return done(err); diff --git a/regtest/p2p.js b/regtest/p2p.js index bb58d7f82..574555a40 100755 --- a/regtest/p2p.js +++ b/regtest/p2p.js @@ -6,22 +6,22 @@ var path = require('path'); var index = require('..'); var log = index.log; -var p2p = require('bitcore-p2p-dash'); +var p2p = require('@dashevo/dashcore-p2p'); var Peer = p2p.Peer; var Messages = p2p.Messages; var chai = require('chai'); -var bitcore = require('bitcore-lib-dash'); -var Transaction = bitcore.Transaction; -var BN = bitcore.crypto.BN; +var dashcore = require('@dashevo/dashcore-lib'); +var Transaction = dashcore.Transaction; +var BN = dashcore.crypto.BN; var async = require('async'); var rimraf = require('rimraf'); -var bitcoind; +var dashd; /* jshint unused: false */ var should = chai.should(); var assert = chai.assert; var sinon = require('sinon'); -var BitcoinRPC = require('bitcoind-rpc-dash'); +var DashdRPC = require('@dashevo/dashd-rpc'); var transactionData = []; var blockHashes = []; var txs = []; @@ -29,9 +29,9 @@ var client; var messages; var peer; var coinbasePrivateKey; -var privateKey = bitcore.PrivateKey(); -var destKey = bitcore.PrivateKey(); -var BufferUtil = bitcore.util.buffer; +var privateKey = dashcore.PrivateKey(); +var destKey = dashcore.PrivateKey(); +var BufferUtil = dashcore.util.buffer; var blocks; describe('P2P Functionality', function() { @@ -40,8 +40,8 @@ describe('P2P Functionality', function() { this.timeout(200000); // enable regtest - bitcore.Networks.enableRegtest(); - var regtestNetwork = bitcore.Networks.get('regtest'); + dashcore.Networks.enableRegtest(); + var regtestNetwork = dashcore.Networks.get('regtest'); var datadir = __dirname + '/data'; rimraf(datadir + '/regtest', function(err) { @@ -49,33 +49,33 @@ describe('P2P Functionality', function() { throw err; } - bitcoind = require('../').services.Bitcoin({ + dashd = require('../').services.Dash({ spawn: { datadir: datadir, - exec: path.resolve(__dirname, process.env.HOME, './.bitcore/data/dashd') + exec: path.resolve(__dirname, process.env.HOME, './.dashcore/data/dashd') }, node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet } }); - bitcoind.on('error', function(err) { + dashd.on('error', function(err) { log.error('error="%s"', err.message); }); log.info('Waiting for Dash Core to initialize...'); - bitcoind.start(function(err) { + dashd.start(function(err) { if (err) { throw err; } - log.info('Bitcoind started'); + log.info('Dashd started'); - client = new BitcoinRPC({ + client = new DashdRPC({ protocol: 'http', host: '127.0.0.1', port: 30331, - user: 'bitcoin', + user: 'dash', pass: 'local321', rejectUnauthorized: false }); @@ -130,11 +130,11 @@ describe('P2P Functionality', function() { throw err; } utxo.privateKeyWIF = privresponse.result; - var tx = bitcore.Transaction(); + var tx = dashcore.Transaction(); tx.from(utxo); tx.change(privateKey.toAddress()); tx.to(destKey.toAddress(), utxo.amount * 1e8 - 1000); - tx.sign(bitcore.PrivateKey.fromWIF(utxo.privateKeyWIF)); + tx.sign(dashcore.PrivateKey.fromWIF(utxo.privateKeyWIF)); txs.push(tx); finished(); }); @@ -163,8 +163,8 @@ describe('P2P Functionality', function() { this.timeout(20000); peer.on('disconnect', function() { log.info('Peer disconnected'); - bitcoind.node.stopping = true; - bitcoind.stop(function(err, result) { + dashd.node.stopping = true; + dashd.stop(function(err, result) { done(); }); }); @@ -176,7 +176,7 @@ describe('P2P Functionality', function() { var usedTxs = {}; - bitcoind.on('tx', function(buffer) { + dashd.on('tx', function(buffer) { var txFromResult = new Transaction().fromBuffer(buffer); var tx = usedTxs[txFromResult.id]; should.exist(tx); diff --git a/scripts/regtest b/regtest/regtest similarity index 56% rename from scripts/regtest rename to regtest/regtest index 96078911d..9ea555aa4 100755 --- a/scripts/regtest +++ b/regtest/regtest @@ -3,6 +3,6 @@ set -e _mocha -R spec regtest/p2p.js -_mocha -R spec regtest/bitcoind.js +_mocha -R spec regtest/dashd.js _mocha -R spec regtest/cluster.js -_mocha -R spec regtest/node.js +_mocha -R spec regtest/node.js \ No newline at end of file diff --git a/scripts/download b/scripts/download deleted file mode 100755 index 9095376d3..000000000 --- a/scripts/download +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -set -e - -root_dir="${HOME}/.bitcore" -platform=`uname -a | awk '{print tolower($1)}'` -arch=`uname -m` -version="0.12.2" -url="https://bamboo.dash.org/browse/DASHL-REL-13/artifact/JOB1/gitian-linux-dash-dist" - -if [ "${platform}" == "linux" ]; then - if [ "${arch}" == "x86_64" ]; then - tarball_name="dashcore-${version}-linux64.tar.gz" - elif [ "${arch}" == "x86_32" ]; then - tarball_name="dashcore-${version}-linux32.tar.gz" - fi -elif [ "${platform}" == "darwin" ]; then - tarball_name="dashcore-${version}-osx64.tar.gz" -else - echo "Dash binary distribution not available for platform and architecture" - exit -1 -fi - -binary_url="${url}/${tarball_name}" -shasums_url="${url}/SHA256SUMS.asc" - -download_bitcoind() { - - mkdir -p "${root_dir}" - mkdir -p "${root_dir}/data" - - cd "${root_dir}/data" - - echo "Downloading dash: ${binary_url}" - - is_curl=true - if hash curl 2>/dev/null; then - curl --fail -I $binary_url >/dev/null 2>&1 - else - is_curl=false - wget --server-response --spider $binary_url >/dev/null 2>&1 - fi - - if test $? -eq 0; then - if [ "${is_curl}" = true ]; then - curl -L $binary_url > $tarball_name - curl -L $shasums_url > SHA256SUMS.asc - else - wget $binary_url - wget $shasums_url - fi - if test -e "${tarball_name}"; then - echo "Unpacking dash distribution" - tar -xvzf $tarball_name - if test $? -eq 0; then - ln -sf "dashcore-${version}/bin/dashd" - return; - fi - fi - fi - echo "Dash binary distribution could not be downloaded" - exit -1 -} - -verify_download() { - echo "Verifying signatures of dash download" - gpg --verify "${root_dir}/bin/SHA256SUMS.asc" - - if hash shasum 2>/dev/null; then - shasum_cmd="shasum -a 256" - else - shasum_cmd="sha256sum" - fi - - download_sha=$(${shasum_cmd} "${root_dir}/bin/${tarball_name}" | awk '{print $1}') - expected_sha=$(cat "${root_dir}/bin/SHA256SUMS.asc" | grep "${tarball_name}" | awk '{print $1}') - echo "Checksum (download): ${download_sha}" - echo "Checksum (verified): ${expected_sha}" - if [ "${download_sha}" != "${expected_sha}" ]; then - echo -e "\033[1;31mChecksums did NOT match!\033[0m\n" - exit 1 - else - echo -e "\033[1;32mChecksums matched!\033[0m\n" - fi -} - -download=1 -verify=0 - -if [ "${SKIP_BITCOIN_DOWNLOAD}" = 1 ]; then - download=0; -fi - -if [ "${VERIFY_BITCOIN_DOWNLOAD}" = 1 ]; then - verify=1; -fi - -while [ -n "$1" ]; do - param="$1" - value="$2" - - case $param in - --skip-bitcoin-download) - download=0 - ;; - --verify-bitcoin-download) - verify=1 - ;; - esac - shift -done - -if [ "${download}" = 1 ]; then - download_bitcoind -fi - -if [ "${verify}" = 1 ]; then - verify_download -fi - -exit 0 diff --git a/test/bus.integration.js b/test/bus.integration.js index 42a27d844..ae34874d5 100644 --- a/test/bus.integration.js +++ b/test/bus.integration.js @@ -2,7 +2,7 @@ var sinon = require('sinon'); var Service = require('../lib/service'); -var BitcoreNode = require('../lib/node'); +var DashcoreNode = require('../lib/node'); var util = require('util'); var should = require('chai').should(); var index = require('../lib'); @@ -53,7 +53,7 @@ describe('Bus Functionality', function() { }); it('should subscribe to testEvent', function(done) { - var node = new BitcoreNode({ + var node = new DashcoreNode({ datadir: './', network: 'testnet', port: 8888, @@ -77,7 +77,7 @@ describe('Bus Functionality', function() { }); it('should unsubscribe from a testEvent', function(done) { - var node = new BitcoreNode({ + var node = new DashcoreNode({ datadir: './', network: 'testnet', port: 8888, diff --git a/test/data/badbitcoin.conf b/test/data/baddash.conf similarity index 89% rename from test/data/badbitcoin.conf rename to test/data/baddash.conf index c69affa14..8f93eebe4 100644 --- a/test/data/badbitcoin.conf +++ b/test/data/baddash.conf @@ -10,7 +10,7 @@ port=20000 rpcallowip=127.0.0.1 -rpcuser=bitcoin +rpcuser=dash rpcpassword=local321 diff --git a/test/data/bitcoin-transactions.json b/test/data/dash-transactions.json similarity index 100% rename from test/data/bitcoin-transactions.json rename to test/data/dash-transactions.json diff --git a/test/data/bitcoin.conf b/test/data/dash.conf similarity index 95% rename from test/data/bitcoin.conf rename to test/data/dash.conf index b26a646e7..7103a98be 100644 --- a/test/data/bitcoin.conf +++ b/test/data/dash.conf @@ -20,5 +20,5 @@ rpcport=50001 rpcallowip=127.0.0.1 -rpcuser=bitcoin +rpcuser=dash rpcpassword=local321 diff --git a/test/data/default.bitcoin.conf b/test/data/default.dash.conf similarity index 92% rename from test/data/default.bitcoin.conf rename to test/data/default.dash.conf index 3ece4569b..d73bac105 100644 --- a/test/data/default.bitcoin.conf +++ b/test/data/default.dash.conf @@ -10,4 +10,4 @@ zmqpubhashblock=tcp://127.0.0.1:28332 rpcallowip=127.0.0.1 rpcuser=dash rpcpassword=local321 -uacomment=bitcore +uacomment=dashcore diff --git a/test/index.unit.js b/test/index.unit.js index 8c72f47dc..4245c9484 100644 --- a/test/index.unit.js +++ b/test/index.unit.js @@ -3,10 +3,10 @@ var should = require('chai').should(); describe('Index Exports', function() { - it('will export bitcore-lib', function() { - var bitcore = require('../'); - should.exist(bitcore.lib); - should.exist(bitcore.lib.Transaction); - should.exist(bitcore.lib.Block); + it('will export dashcore-lib', function() { + var dashcore = require('../'); + should.exist(dashcore.lib); + should.exist(dashcore.lib.Transaction); + should.exist(dashcore.lib.Block); }); }); diff --git a/test/logger.unit.js b/test/logger.unit.js index 755228145..1e983c93e 100644 --- a/test/logger.unit.js +++ b/test/logger.unit.js @@ -41,10 +41,19 @@ describe('Logger', function() { console.error.callCount.should.equal(1); console.error.restore(); - sandbox.stub(console, 'log'); - logger.debug('Test debug log'); - console.log.callCount.should.equal(1); - console.log.restore(); + //Node 6+ + if(console.hasOwnProperty('debug')){ + sandbox.stub(console, 'debug'); + logger.debug('Test debug log'); + console.debug.callCount.should.equal(1); + console.debug.restore(); + }else{ + sandbox.stub(console, 'log'); + logger.debug('Test debug log'); + console.log.callCount.should.equal(1); + console.log.restore(); + } + sandbox.stub(console, 'warn'); logger.warn('Test warn log'); @@ -66,12 +75,21 @@ describe('Logger', function() { console.error.callCount.should.equal(1); console.error.args[0][0].should.be.instanceof(Error); console.error.restore(); + //Node 6+ + if(console.hasOwnProperty('debug')){ + sandbox.stub(console, 'debug'); + logger.debug('Test debug log'); + console.debug.callCount.should.equal(1); + should.equal(console.debug.args[0][0].match(/^\[/), null); + console.debug.restore(); + }else{ + sandbox.stub(console, 'log'); + logger.debug('Test debug log'); + console.log.callCount.should.equal(1); + should.equal(console.log.args[0][0].match(/^\[/), null); + console.log.restore(); + } - sandbox.stub(console, 'log'); - logger.debug('Test debug log'); - console.log.callCount.should.equal(1); - should.equal(console.log.args[0][0].match(/^\[/), null); - console.log.restore(); sandbox.stub(console, 'warn'); logger.warn('Test warn log'); diff --git a/test/node.unit.js b/test/node.unit.js index 83d5668fa..fee696dc5 100644 --- a/test/node.unit.js +++ b/test/node.unit.js @@ -2,15 +2,15 @@ var should = require('chai').should(); var sinon = require('sinon'); -var bitcore = require('bitcore-lib-dash'); -var Networks = bitcore.Networks; +var dashcore = require('@dashevo/dashcore-lib'); +var Networks = dashcore.Networks; var proxyquire = require('proxyquire'); var util = require('util'); var BaseService = require('../lib/service'); var index = require('../lib'); var log = index.log; -describe('Bitcore Node', function() { +describe('Dashcore Node', function() { var baseConfig = {}; @@ -425,7 +425,7 @@ describe('Bitcore Node', function() { describe('#getNetworkName', function() { afterEach(function() { - bitcore.Networks.disableRegtest(); + dashcore.Networks.disableRegtest(); }); it('it will return the network name for livenet', function() { var node = new Node(baseConfig); diff --git a/test/scaffold/add.integration.js b/test/scaffold/add.integration.js index 687d0c489..47baf741c 100644 --- a/test/scaffold/add.integration.js +++ b/test/scaffold/add.integration.js @@ -25,7 +25,7 @@ describe('#add', function() { throw err; } fs.writeFile( - testDir + '/s0/s1/bitcore-node-dash.json', + testDir + '/s0/s1/dashcore-node.json', JSON.stringify(startConfig), function(err) { if (err) { @@ -90,12 +90,12 @@ describe('#add', function() { }); }); - it('will update bitcore-node-dash.json services', function(done) { + it('will update dashcore-node.json services', function(done) { var callCount = 0; var oldPackage = { dependencies: { - 'bitcore-lib-dash': '^v0.13.17', - 'bitcore-node-dash': '^v0.2.0' + '@dashevo/dashcore-lib': '^v0.15.4', + '@dashevo/dashcore-node': '^v3.0.7' } }; var spawn = sinon.stub().returns({ @@ -130,7 +130,7 @@ describe('#add', function() { services: ['a', 'b', 'c'] }, function(err) { should.not.exist(err); - var configPath = path.resolve(testDir, 's0/s1/bitcore-node-dash.json'); + var configPath = path.resolve(testDir, 's0/s1/dashcore-node.json'); var config = JSON.parse(fs.readFileSync(configPath)); config.services.should.deep.equal(['a','b','c']); done(); diff --git a/test/scaffold/create.integration.js b/test/scaffold/create.integration.js index 6f0635fc9..dc9e39692 100644 --- a/test/scaffold/create.integration.js +++ b/test/scaffold/create.integration.js @@ -33,7 +33,7 @@ describe('#create', function() { if (err) { throw err; } - mkdirp(testDir + '/.bitcoin', function(err) { + mkdirp(testDir + '/.dash', function(err) { if (err) { throw err; } @@ -64,14 +64,14 @@ describe('#create', function() { throw err; } - var configPath = testDir + '/mynode/bitcore-node-dash.json'; + var configPath = testDir + '/mynode/dashcore-node.json'; var packagePath = testDir + '/mynode/package.json'; should.equal(fs.existsSync(configPath), true); should.equal(fs.existsSync(packagePath), true); var config = JSON.parse(fs.readFileSync(configPath)); - config.services.should.deep.equal(['bitcoind', 'db', 'address', 'web']); + config.services.should.deep.equal(['dashd', 'db', 'address', 'web']); config.datadir.should.equal('./data'); config.network.should.equal('livenet'); @@ -104,7 +104,7 @@ describe('#create', function() { dirname: 'mynode3', name: 'My Node 3', isGlobal: true, - datadir: '../.bitcoin' + datadir: '../.dash' }, function(err) { if (err) { throw err; @@ -139,7 +139,7 @@ describe('#create', function() { dirname: 'mynode4', name: 'My Node 4', isGlobal: false, - datadir: '../.bitcoin' + datadir: '../.dash' }, function(err) { should.exist(err); err.message.should.equal('There was an error installing dependencies.'); diff --git a/test/scaffold/default-base-config.integration.js b/test/scaffold/default-base-config.integration.js index 23a46b2a1..7fcf21294 100644 --- a/test/scaffold/default-base-config.integration.js +++ b/test/scaffold/default-base-config.integration.js @@ -12,10 +12,10 @@ describe('#defaultBaseConfig', function() { info.path.should.equal(cwd); info.config.network.should.equal('livenet'); info.config.port.should.equal(3001); - info.config.services.should.deep.equal(['bitcoind', 'web']); - var bitcoind = info.config.servicesConfig.bitcoind; - bitcoind.spawn.datadir.should.equal(home + '/.dash'); - bitcoind.spawn.exec.should.equal(path.resolve(__dirname, process.env.HOME, './.dash/dashd')); + info.config.services.should.deep.equal(['dashd', 'web']); + var dashd = info.config.servicesConfig.dashd; + dashd.spawn.datadir.should.equal(home + '/.dash'); + dashd.spawn.exec.should.equal(path.resolve(__dirname, process.env.HOME, './.dash/dashd')); }); it('be able to specify a network', function() { var info = defaultBaseConfig({network: 'testnet'}); @@ -23,6 +23,6 @@ describe('#defaultBaseConfig', function() { }); it('be able to specify a datadir', function() { var info = defaultBaseConfig({datadir: './data2', network: 'testnet'}); - info.config.servicesConfig.bitcoind.spawn.datadir.should.equal('./data2'); + info.config.servicesConfig.dashd.spawn.datadir.should.equal('./data2'); }); }); diff --git a/test/scaffold/default-config.integration.js b/test/scaffold/default-config.integration.js index e2d2a920c..ac2df6c31 100644 --- a/test/scaffold/default-config.integration.js +++ b/test/scaffold/default-config.integration.js @@ -6,22 +6,25 @@ var sinon = require('sinon'); var proxyquire = require('proxyquire'); describe('#defaultConfig', function() { - var expectedExecPath = path.resolve(__dirname, process.env.HOME, './.bitcore/data/dashd'); + var expectedExecPath = path.resolve(__dirname, process.env.HOME, './.dashcore/data/dashd'); it('will return expected configuration', function() { var config = JSON.stringify({ network: 'livenet', port: 3001, services: [ - 'bitcoind', + 'dashd', 'web' ], servicesConfig: { - bitcoind: { - spawn: { - datadir: process.env.HOME + '/.bitcore/data', - exec: expectedExecPath - } + dashd: { + connect: [{ + rpchost: '127.0.0.1', + rpcport: 9998, + rpcuser: 'dash', + rpcpassword: 'local321', + zmqpubrawtx: 'tcp://127.0.0.1:28332' + }] } } }, null, 2); @@ -29,7 +32,7 @@ describe('#defaultConfig', function() { fs: { existsSync: sinon.stub().returns(false), writeFileSync: function(path, data) { - path.should.equal(process.env.HOME + '/.bitcore/bitcore-node-dash.json'); + path.should.equal(process.env.HOME + '/.dashcore/dashcore-node.json'); data.should.equal(config); }, readFileSync: function() { @@ -42,31 +45,32 @@ describe('#defaultConfig', function() { }); var home = process.env.HOME; var info = defaultConfig(); - info.path.should.equal(home + '/.bitcore'); + info.path.should.equal(home + '/.dashcore'); info.config.network.should.equal('livenet'); info.config.port.should.equal(3001); - info.config.services.should.deep.equal(['bitcoind', 'web']); - var bitcoind = info.config.servicesConfig.bitcoind; - should.exist(bitcoind); - bitcoind.spawn.datadir.should.equal(home + '/.bitcore/data'); - bitcoind.spawn.exec.should.equal(expectedExecPath); + info.config.services.should.deep.equal(['dashd', 'web']); + var dashd = info.config.servicesConfig.dashd; + should.exist(dashd); }); it('will include additional services', function() { var config = JSON.stringify({ network: 'livenet', port: 3001, services: [ - 'bitcoind', + 'dashd', 'web', 'insight-api', 'insight-ui' ], servicesConfig: { - bitcoind: { - spawn: { - datadir: process.env.HOME + '/.bitcore/data', - exec: expectedExecPath - } + dashd: { + connect: [{ + rpchost: '127.0.0.1', + rpcport: 9998, + rpcuser: 'dash', + rpcpassword: 'local321', + zmqpubrawtx: 'tcp://127.0.0.1:28332' + }] } } }, null, 2); @@ -74,7 +78,7 @@ describe('#defaultConfig', function() { fs: { existsSync: sinon.stub().returns(false), writeFileSync: function(path, data) { - path.should.equal(process.env.HOME + '/.bitcore/bitcore-node-dash.json'); + path.should.equal(process.env.HOME + '/.dashcore/dashcore-node.json'); data.should.equal(config); }, readFileSync: function() { @@ -89,18 +93,16 @@ describe('#defaultConfig', function() { var info = defaultConfig({ additionalServices: ['insight-api', 'insight-ui'] }); - info.path.should.equal(home + '/.bitcore'); + info.path.should.equal(home + '/.dashcore'); info.config.network.should.equal('livenet'); info.config.port.should.equal(3001); info.config.services.should.deep.equal([ - 'bitcoind', + 'dashd', 'web', 'insight-api', 'insight-ui' ]); - var bitcoind = info.config.servicesConfig.bitcoind; - should.exist(bitcoind); - bitcoind.spawn.datadir.should.equal(home + '/.bitcore/data'); - bitcoind.spawn.exec.should.equal(expectedExecPath); + var dashd = info.config.servicesConfig.dashd; + should.exist(dashd); }); }); diff --git a/test/scaffold/find-config.integration.js b/test/scaffold/find-config.integration.js index afdb3b96d..c546a798a 100644 --- a/test/scaffold/find-config.integration.js +++ b/test/scaffold/find-config.integration.js @@ -23,7 +23,7 @@ describe('#findConfig', function() { throw err; } fs.writeFile( - testDir + '/p2/bitcore-node-dash.json', + testDir + '/p2/dashcore-node.json', JSON.stringify(expectedConfig), function() { mkdirp(testDir + '/e0', function(err) { diff --git a/test/scaffold/remove.integration.js b/test/scaffold/remove.integration.js index ba2acfc20..7e85eb647 100644 --- a/test/scaffold/remove.integration.js +++ b/test/scaffold/remove.integration.js @@ -25,7 +25,7 @@ describe('#remove', function() { throw err; } fs.writeFile( - testDir + '/s0/s1/bitcore-node-dash.json', + testDir + '/s0/s1/dashcore-node.json', JSON.stringify(startConfig), function(err) { if (err) { @@ -64,7 +64,7 @@ describe('#remove', function() { }); }); - it('will update bitcore-node-dash.json services', function(done) { + it('will update dashcore-node.json services', function(done) { var spawn = sinon.stub().returns({ stdout: { on: sinon.stub() @@ -92,7 +92,7 @@ describe('#remove', function() { services: ['b'] }, function(err) { should.not.exist(err); - var configPath = path.resolve(testDir, 's0/s1/bitcore-node-dash.json'); + var configPath = path.resolve(testDir, 's0/s1/dashcore-node.json'); var config = JSON.parse(fs.readFileSync(configPath)); config.services.should.deep.equal(['a', 'c']); done(); diff --git a/test/scaffold/start.integration.js b/test/scaffold/start.integration.js index 7120b5b00..2e5ecccdd 100644 --- a/test/scaffold/start.integration.js +++ b/test/scaffold/start.integration.js @@ -3,7 +3,7 @@ var should = require('chai').should(); var sinon = require('sinon'); var proxyquire = require('proxyquire'); -var BitcoinService = require('../../lib/services/bitcoind'); +var DashService = require('../../lib/services/dashd'); var index = require('../../lib'); var log = index.log; @@ -19,12 +19,12 @@ describe('#start', function() { describe('will dynamically create a node from a configuration', function() { - it('require each bitcore-node-dash service with default config', function(done) { + it('require each dashcore-node service with default config', function(done) { var node; var TestNode = function(options) { options.services[0].should.deep.equal({ - name: 'bitcoind', - module: BitcoinService, + name: 'dashd', + module: DashService, config: { spawn: { datadir: './data' @@ -48,10 +48,10 @@ describe('#start', function() { path: __dirname, config: { services: [ - 'bitcoind' + 'dashd' ], servicesConfig: { - bitcoind: { + dashd: { spawn: { datadir: './data' } @@ -87,12 +87,12 @@ describe('#start', function() { done(); }); }); - it('require each bitcore-node-dash service with explicit config', function(done) { + it('require each dashcore-node service with explicit config', function(done) { var node; var TestNode = function(options) { options.services[0].should.deep.equal({ - name: 'bitcoind', - module: BitcoinService, + name: 'dashd', + module: DashService, config: { param: 'test', spawn: { @@ -116,10 +116,10 @@ describe('#start', function() { path: __dirname, config: { services: [ - 'bitcoind' + 'dashd' ], servicesConfig: { - 'bitcoind': { + 'dashd': { param: 'test', spawn: { datadir: './data' diff --git a/test/scaffold/start.unit.js b/test/scaffold/start.unit.js index efc062999..49a670f42 100644 --- a/test/scaffold/start.unit.js +++ b/test/scaffold/start.unit.js @@ -18,7 +18,7 @@ describe('#start', function() { }); it('will give true with "datadir" at root', function() { var checkConfigVersion2 = proxyquire('../../lib/scaffold/start', {}).checkConfigVersion2; - var v2 = checkConfigVersion2({datadir: '/home/user/.bitcore/data', services: []}); + var v2 = checkConfigVersion2({datadir: '/home/user/.dashcore/data', services: []}); v2.should.equal(true); }); it('will give true with "address" service enabled', function() { @@ -87,7 +87,7 @@ describe('#start', function() { services[0].name.should.equal('local'); services[0].module.should.equal(LocalService); }); - it('will require a local module with "bitcoreNode" in package.json', function() { + it('will require a local module with "dashcoreNode" in package.json', function() { function LocalService() {} LocalService.dependencies = []; LocalService.prototype.start = sinon.stub(); @@ -99,9 +99,9 @@ describe('#start', function() { } else if (p === 'local/package.json') { return { name: 'local', - bitcoreNode: 'lib/bitcoreNode.js' + dashcoreNode: 'lib/dashcoreNode.js' }; - } else if (p === 'local/lib/bitcoreNode.js') { + } else if (p === 'local/lib/dashcoreNode.js') { return LocalService; } }; @@ -118,7 +118,7 @@ describe('#start', function() { return internal; }; var config = { - services: ['bitcoind'] + services: ['dashd'] }; (function() { setupServices(testRequire, cwd, config); diff --git a/test/services/bitcoind.unit.js b/test/services/dashd.unit.js similarity index 69% rename from test/services/bitcoind.unit.js rename to test/services/dashd.unit.js index b1ad6b869..d6286199d 100644 --- a/test/services/bitcoind.unit.js +++ b/test/services/dashd.unit.js @@ -6,8 +6,8 @@ var path = require('path'); var EventEmitter = require('events').EventEmitter; var should = require('chai').should(); var crypto = require('crypto'); -var bitcore = require('bitcore-lib-dash'); -var _ = bitcore.deps._; +var dashcore = require('@dashevo/dashcore-lib'); +var _ = dashcore.deps._; var sinon = require('sinon'); var proxyquire = require('proxyquire'); var fs = require('fs'); @@ -17,21 +17,21 @@ var index = require('../../lib'); var log = index.log; var errors = index.errors; -var Transaction = bitcore.Transaction; -var readFileSync = sinon.stub().returns(fs.readFileSync(path.resolve(__dirname, '../data/bitcoin.conf'))); -var BitcoinService = proxyquire('../../lib/services/bitcoind', { +var Transaction = dashcore.Transaction; +var readFileSync = sinon.stub().returns(fs.readFileSync(path.resolve(__dirname, '../data/dash.conf'))); +var DashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync } }); -var defaultBitcoinConf = fs.readFileSync(path.resolve(__dirname, '../data/default.bitcoin.conf'), 'utf8'); +var defaultDashConf = fs.readFileSync(path.resolve(__dirname, '../data/default.dash.conf'), 'utf8'); -describe('Bitcoin Service', function() { +describe('Dash Service', function() { var txhex = '01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000'; var baseConfig = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', @@ -41,42 +41,42 @@ describe('Bitcoin Service', function() { describe('@constructor', function() { it('will create an instance', function() { - var bitcoind = new BitcoinService(baseConfig); - should.exist(bitcoind); + var dashd = new DashService(baseConfig); + should.exist(dashd); }); it('will create an instance without `new`', function() { - var bitcoind = BitcoinService(baseConfig); - should.exist(bitcoind); + var dashd = DashService(baseConfig); + should.exist(dashd); }); it('will init caches', function() { - var bitcoind = new BitcoinService(baseConfig); - should.exist(bitcoind.utxosCache); - should.exist(bitcoind.txidsCache); - should.exist(bitcoind.balanceCache); - should.exist(bitcoind.summaryCache); - should.exist(bitcoind.transactionDetailedCache); - should.exist(bitcoind.masternodeListCache); + var dashd = new DashService(baseConfig); + should.exist(dashd.utxosCache); + should.exist(dashd.txidsCache); + should.exist(dashd.balanceCache); + should.exist(dashd.summaryCache); + should.exist(dashd.transactionDetailedCache); + should.exist(dashd.masternodeListCache); - should.exist(bitcoind.transactionCache); - should.exist(bitcoind.rawTransactionCache); - should.exist(bitcoind.blockCache); - should.exist(bitcoind.rawBlockCache); - should.exist(bitcoind.blockHeaderCache); - should.exist(bitcoind.zmqKnownTransactions); - should.exist(bitcoind.zmqKnownBlocks); - should.exist(bitcoind.lastTip); - should.exist(bitcoind.lastTipTimeout); + should.exist(dashd.transactionCache); + should.exist(dashd.rawTransactionCache); + should.exist(dashd.blockCache); + should.exist(dashd.rawBlockCache); + should.exist(dashd.blockHeaderCache); + should.exist(dashd.zmqKnownTransactions); + should.exist(dashd.zmqKnownBlocks); + should.exist(dashd.lastTip); + should.exist(dashd.lastTipTimeout); }); it('will init clients', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.should.deep.equal([]); - bitcoind.nodesIndex.should.equal(0); - bitcoind.nodes.push({client: sinon.stub()}); - should.exist(bitcoind.client); + var dashd = new DashService(baseConfig); + dashd.nodes.should.deep.equal([]); + dashd.nodesIndex.should.equal(0); + dashd.nodes.push({client: sinon.stub()}); + should.exist(dashd.client); }); it('will set subscriptions', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.subscriptions.should.deep.equal({ + var dashd = new DashService(baseConfig); + dashd.subscriptions.should.deep.equal({ address: {}, rawtransaction: [], hashblock: [], @@ -87,24 +87,24 @@ describe('Bitcoin Service', function() { describe('#_initDefaults', function() { it('will set transaction concurrency', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._initDefaults({transactionConcurrency: 10}); - bitcoind.transactionConcurrency.should.equal(10); - bitcoind._initDefaults({}); - bitcoind.transactionConcurrency.should.equal(5); + var dashd = new DashService(baseConfig); + dashd._initDefaults({transactionConcurrency: 10}); + dashd.transactionConcurrency.should.equal(10); + dashd._initDefaults({}); + dashd.transactionConcurrency.should.equal(5); }); }); describe('@dependencies', function() { it('will have no dependencies', function() { - BitcoinService.dependencies.should.deep.equal([]); + DashService.dependencies.should.deep.equal([]); }); }); describe('#getAPIMethods', function() { it('will return spec', function() { - var bitcoind = new BitcoinService(baseConfig); - var methods = bitcoind.getAPIMethods(); + var dashd = new DashService(baseConfig); + var methods = dashd.getAPIMethods(); should.exist(methods); methods.length.should.equal(23); }); @@ -112,56 +112,56 @@ describe('Bitcoin Service', function() { describe('#getPublishEvents', function() { it('will return spec', function() { - var bitcoind = new BitcoinService(baseConfig); - var events = bitcoind.getPublishEvents(); + var dashd = new DashService(baseConfig); + var events = dashd.getPublishEvents(); should.exist(events); events.length.should.equal(4); - events[0].name.should.equal('bitcoind/rawtransaction'); - events[0].scope.should.equal(bitcoind); + events[0].name.should.equal('dashd/rawtransaction'); + events[0].scope.should.equal(dashd); events[0].subscribe.should.be.a('function'); events[0].unsubscribe.should.be.a('function'); - events[1].name.should.equal('bitcoind/transactionlock'); - events[1].scope.should.equal(bitcoind); + events[1].name.should.equal('dashd/transactionlock'); + events[1].scope.should.equal(dashd); events[1].subscribe.should.be.a('function'); events[1].unsubscribe.should.be.a('function'); - events[2].name.should.equal('bitcoind/hashblock'); - events[2].scope.should.equal(bitcoind); + events[2].name.should.equal('dashd/hashblock'); + events[2].scope.should.equal(dashd); events[2].subscribe.should.be.a('function'); events[2].unsubscribe.should.be.a('function'); - events[3].name.should.equal('bitcoind/addresstxid'); - events[3].scope.should.equal(bitcoind); + events[3].name.should.equal('dashd/addresstxid'); + events[3].scope.should.equal(dashd); events[3].subscribe.should.be.a('function'); events[3].unsubscribe.should.be.a('function'); }); it('will call subscribe/unsubscribe with correct args', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.subscribe = sinon.stub(); - bitcoind.unsubscribe = sinon.stub(); - var events = bitcoind.getPublishEvents(); + var dashd = new DashService(baseConfig); + dashd.subscribe = sinon.stub(); + dashd.unsubscribe = sinon.stub(); + var events = dashd.getPublishEvents(); events[0].subscribe('test'); - bitcoind.subscribe.args[0][0].should.equal('rawtransaction'); - bitcoind.subscribe.args[0][1].should.equal('test'); + dashd.subscribe.args[0][0].should.equal('rawtransaction'); + dashd.subscribe.args[0][1].should.equal('test'); events[0].unsubscribe('test'); - bitcoind.unsubscribe.args[0][0].should.equal('rawtransaction'); - bitcoind.unsubscribe.args[0][1].should.equal('test'); + dashd.unsubscribe.args[0][0].should.equal('rawtransaction'); + dashd.unsubscribe.args[0][1].should.equal('test'); events[1].subscribe('test'); - bitcoind.subscribe.args[1][0].should.equal('transactionlock'); - bitcoind.subscribe.args[1][1].should.equal('test'); + dashd.subscribe.args[1][0].should.equal('transactionlock'); + dashd.subscribe.args[1][1].should.equal('test'); events[1].unsubscribe('test'); - bitcoind.unsubscribe.args[1][0].should.equal('transactionlock'); - bitcoind.unsubscribe.args[1][1].should.equal('test'); + dashd.unsubscribe.args[1][0].should.equal('transactionlock'); + dashd.unsubscribe.args[1][1].should.equal('test'); events[2].subscribe('test'); - bitcoind.subscribe.args[2][0].should.equal('hashblock'); - bitcoind.subscribe.args[2][1].should.equal('test'); + dashd.subscribe.args[2][0].should.equal('hashblock'); + dashd.subscribe.args[2][1].should.equal('test'); events[2].unsubscribe('test'); - bitcoind.unsubscribe.args[2][0].should.equal('hashblock'); - bitcoind.unsubscribe.args[2][1].should.equal('test'); + dashd.unsubscribe.args[2][0].should.equal('hashblock'); + dashd.unsubscribe.args[2][1].should.equal('test'); }); }); @@ -174,14 +174,14 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will push to subscriptions', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter = {}; - bitcoind.subscribe('hashblock', emitter); - bitcoind.subscriptions.hashblock[0].should.equal(emitter); + dashd.subscribe('hashblock', emitter); + dashd.subscriptions.hashblock[0].should.equal(emitter); var emitter2 = {}; - bitcoind.subscribe('rawtransaction', emitter2); - bitcoind.subscriptions.rawtransaction[0].should.equal(emitter2); + dashd.subscribe('rawtransaction', emitter2); + dashd.subscriptions.rawtransaction[0].should.equal(emitter2); }); }); @@ -194,34 +194,34 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will remove item from subscriptions', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = {}; var emitter2 = {}; var emitter3 = {}; var emitter4 = {}; var emitter5 = {}; - bitcoind.subscribe('hashblock', emitter1); - bitcoind.subscribe('hashblock', emitter2); - bitcoind.subscribe('hashblock', emitter3); - bitcoind.subscribe('hashblock', emitter4); - bitcoind.subscribe('hashblock', emitter5); - bitcoind.subscriptions.hashblock.length.should.equal(5); + dashd.subscribe('hashblock', emitter1); + dashd.subscribe('hashblock', emitter2); + dashd.subscribe('hashblock', emitter3); + dashd.subscribe('hashblock', emitter4); + dashd.subscribe('hashblock', emitter5); + dashd.subscriptions.hashblock.length.should.equal(5); - bitcoind.unsubscribe('hashblock', emitter3); - bitcoind.subscriptions.hashblock.length.should.equal(4); - bitcoind.subscriptions.hashblock[0].should.equal(emitter1); - bitcoind.subscriptions.hashblock[1].should.equal(emitter2); - bitcoind.subscriptions.hashblock[2].should.equal(emitter4); - bitcoind.subscriptions.hashblock[3].should.equal(emitter5); + dashd.unsubscribe('hashblock', emitter3); + dashd.subscriptions.hashblock.length.should.equal(4); + dashd.subscriptions.hashblock[0].should.equal(emitter1); + dashd.subscriptions.hashblock[1].should.equal(emitter2); + dashd.subscriptions.hashblock[2].should.equal(emitter4); + dashd.subscriptions.hashblock[3].should.equal(emitter5); }); it('will not remove item an already unsubscribed item', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = {}; var emitter3 = {}; - bitcoind.subscriptions.hashblock= [emitter1]; - bitcoind.unsubscribe('hashblock', emitter3); - bitcoind.subscriptions.hashblock.length.should.equal(1); - bitcoind.subscriptions.hashblock[0].should.equal(emitter1); + dashd.subscriptions.hashblock= [emitter1]; + dashd.unsubscribe('hashblock', emitter3); + dashd.subscriptions.hashblock.length.should.equal(1); + dashd.subscriptions.hashblock[0].should.equal(emitter1); }); }); @@ -234,33 +234,33 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will not an invalid address', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter = new EventEmitter(); - bitcoind.subscribeAddress(emitter, ['invalidaddress']); - should.not.exist(bitcoind.subscriptions.address['invalidaddress']); + dashd.subscribeAddress(emitter, ['invalidaddress']); + should.not.exist(dashd.subscriptions.address['invalidaddress']); }); it('will add a valid address', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter = new EventEmitter(); - bitcoind.subscribeAddress(emitter, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - should.exist(bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscribeAddress(emitter, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + should.exist(dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); }); it('will handle multiple address subscribers', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscribeAddress(emitter2, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - should.exist(bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(2); + dashd.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscribeAddress(emitter2, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + should.exist(dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(2); }); it('will not add the same emitter twice', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); - bitcoind.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - should.exist(bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); + dashd.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + should.exist(dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); }); }); @@ -273,61 +273,61 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('it will remove a subscription', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscribeAddress(emitter2, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - should.exist(bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(2); - bitcoind.unsubscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); + dashd.subscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscribeAddress(emitter2, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + should.exist(dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(2); + dashd.unsubscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); }); it('will unsubscribe subscriptions for an emitter', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; - bitcoind.unsubscribeAddress(emitter1); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; + dashd.unsubscribeAddress(emitter1); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); }); it('will NOT unsubscribe subscription with missing address', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; - bitcoind.unsubscribeAddress(emitter1, ['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs']); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(2); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; + dashd.unsubscribeAddress(emitter1, ['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(2); }); it('will NOT unsubscribe subscription with missing emitter', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter2]; - bitcoind.unsubscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'][0].should.equal(emitter2); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter2]; + dashd.unsubscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'][0].should.equal(emitter2); }); it('will remove empty addresses', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; - bitcoind.unsubscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - bitcoind.unsubscribeAddress(emitter2, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); - should.not.exist(bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; + dashd.unsubscribeAddress(emitter1, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + dashd.unsubscribeAddress(emitter2, ['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); + should.not.exist(dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi']); }); it('will unsubscribe emitter for all addresses', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; - bitcoind.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'] = [emitter1, emitter2]; - sinon.spy(bitcoind, 'unsubscribeAddressAll'); - bitcoind.unsubscribeAddress(emitter1); - bitcoind.unsubscribeAddressAll.callCount.should.equal(1); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); - bitcoind.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'].length.should.equal(1); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; + dashd.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'] = [emitter1, emitter2]; + sinon.spy(dashd, 'unsubscribeAddressAll'); + dashd.unsubscribeAddress(emitter1); + dashd.unsubscribeAddressAll.callCount.should.equal(1); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); + dashd.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'].length.should.equal(1); }); }); @@ -340,26 +340,26 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will unsubscribe emitter for all addresses', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var emitter1 = new EventEmitter(); var emitter2 = new EventEmitter(); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; - bitcoind.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'] = [emitter1, emitter2]; - bitcoind.subscriptions.address['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'] = [emitter2]; - bitcoind.subscriptions.address['7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'] = [emitter1]; - bitcoind.unsubscribeAddress(emitter1); - bitcoind.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); - bitcoind.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'].length.should.equal(1); - bitcoind.subscriptions.address['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'].length.should.equal(1); - should.not.exist(bitcoind.subscriptions.address['7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz']); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'] = [emitter1, emitter2]; + dashd.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'] = [emitter1, emitter2]; + dashd.subscriptions.address['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'] = [emitter2]; + dashd.subscriptions.address['7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'] = [emitter1]; + dashd.unsubscribeAddress(emitter1); + dashd.subscriptions.address['8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'].length.should.equal(1); + dashd.subscriptions.address['XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'].length.should.equal(1); + dashd.subscriptions.address['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'].length.should.equal(1); + should.not.exist(dashd.subscriptions.address['7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz']); }); }); describe('#_getDefaultConfig', function() { it('will generate config file from defaults', function() { - var bitcoind = new BitcoinService(baseConfig); - var config = bitcoind._getDefaultConfig(); - config.should.equal(defaultBitcoinConf); + var dashd = new DashService(baseConfig); + var config = dashd._getDefaultConfig(); + config.should.equal(defaultDashConf); }); }); @@ -371,8 +371,8 @@ describe('Bitcoin Service', function() { afterEach(function() { sandbox.restore(); }); - it('will parse a bitcoin.conf file', function() { - var TestBitcoin = proxyquire('../../lib/services/bitcoind', { + it('will parse a dash.conf file', function() { + var TestDash = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync, existsSync: sinon.stub().returns(true), @@ -382,12 +382,12 @@ describe('Bitcoin Service', function() { sync: sinon.stub() } }); - var bitcoind = new TestBitcoin(baseConfig); - bitcoind.options.spawn.datadir = '/tmp/.bitcoin'; + var dashd = new TestDash(baseConfig); + dashd.options.spawn.datadir = '/tmp/.dash'; var node = {}; - bitcoind._loadSpawnConfiguration(node); - should.exist(bitcoind.spawn.config); - bitcoind.spawn.config.should.deep.equal({ + dashd._loadSpawnConfiguration(node); + should.exist(dashd.spawn.config); + dashd.spawn.config.should.deep.equal({ addressindex: 1, checkblocks: 144, dbcache: 8192, @@ -395,7 +395,7 @@ describe('Bitcoin Service', function() { port: 20000, rpcport: 50001, rpcallowip: '127.0.0.1', - rpcuser: 'bitcoin', + rpcuser: 'dash', rpcpassword: 'local321', server: 1, spentindex: 1, @@ -409,7 +409,7 @@ describe('Bitcoin Service', function() { }); }); it('will expand relative datadir to absolute path', function() { - var TestBitcoin = proxyquire('../../lib/services/bitcoind', { + var TestDash = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync, existsSync: sinon.stub().returns(true), @@ -421,40 +421,40 @@ describe('Bitcoin Service', function() { }); var config = { node: { - network: bitcore.Networks.testnet, - configPath: '/tmp/.bitcore/bitcore-node.json' + network: dashcore.Networks.testnet, + configPath: '/tmp/.dashcore/dashcore-node.json' }, spawn: { datadir: './data', exec: 'testpath' } }; - var bitcoind = new TestBitcoin(config); - bitcoind.options.spawn.datadir = './data'; + var dashd = new TestDash(config); + dashd.options.spawn.datadir = './data'; var node = {}; - bitcoind._loadSpawnConfiguration(node); - bitcoind.options.spawn.datadir.should.equal('/tmp/.bitcore/data'); + dashd._loadSpawnConfiguration(node); + dashd.options.spawn.datadir.should.equal('/tmp/.dashcore/data'); }); it('should throw an exception if txindex isn\'t enabled in the configuration', function() { - var TestBitcoin = proxyquire('../../lib/services/bitcoind', { + var TestDash = proxyquire('../../lib/services/dashd', { fs: { - readFileSync: sinon.stub().returns(fs.readFileSync(__dirname + '/../data/badbitcoin.conf')), + readFileSync: sinon.stub().returns(fs.readFileSync(__dirname + '/../data/baddash.conf')), existsSync: sinon.stub().returns(true), }, mkdirp: { sync: sinon.stub() } }); - var bitcoind = new TestBitcoin(baseConfig); + var dashd = new TestDash(baseConfig); (function() { - bitcoind._loadSpawnConfiguration({datadir: './test'}); - }).should.throw(bitcore.errors.InvalidState); + dashd._loadSpawnConfiguration({datadir: './test'}); + }).should.throw(dashcore.errors.InvalidState); }); it('should NOT set https options if node https options are set', function() { var writeFileSync = function(path, config) { - config.should.equal(defaultBitcoinConf); + config.should.equal(defaultDashConf); }; - var TestBitcoin = proxyquire('../../lib/services/bitcoind', { + var TestDash = proxyquire('../../lib/services/dashd', { fs: { writeFileSync: writeFileSync, readFileSync: readFileSync, @@ -480,10 +480,10 @@ describe('Bitcoin Service', function() { exec: 'testexec' } }; - var bitcoind = new TestBitcoin(config); - bitcoind.options.spawn.datadir = '/tmp/.bitcoin'; + var dashd = new TestDash(config); + dashd.options.spawn.datadir = '/tmp/.dash'; var node = {}; - bitcoind._loadSpawnConfiguration(node); + dashd._loadSpawnConfiguration(node); }); }); @@ -495,8 +495,8 @@ describe('Bitcoin Service', function() { afterEach(function() { sandbox.restore(); }); - it('should warn the user if reindex is set to 1 in the bitcoin.conf file', function() { - var bitcoind = new BitcoinService(baseConfig); + it('should warn the user if reindex is set to 1 in the dash.conf file', function() { + var dashd = new DashService(baseConfig); var config = { txindex: 1, addressindex: 1, @@ -508,12 +508,12 @@ describe('Bitcoin Service', function() { reindex: 1 }; var node = {}; - bitcoind._checkConfigIndexes(config, node); + dashd._checkConfigIndexes(config, node); log.warn.callCount.should.equal(1); node._reindex.should.equal(true); }); it('should warn if zmq port and hosts do not match', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var config = { txindex: 1, addressindex: 1, @@ -526,113 +526,113 @@ describe('Bitcoin Service', function() { }; var node = {}; (function() { - bitcoind._checkConfigIndexes(config, node); + dashd._checkConfigIndexes(config, node); }).should.throw('"zmqpubrawtx" and "zmqpubhashblock"'); }); }); describe('#_resetCaches', function() { it('will reset LRU caches', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var keys = []; for (var i = 0; i < 10; i++) { keys.push(crypto.randomBytes(32)); - bitcoind.transactionDetailedCache.set(keys[i], {}); - bitcoind.utxosCache.set(keys[i], {}); - bitcoind.txidsCache.set(keys[i], {}); - bitcoind.balanceCache.set(keys[i], {}); - bitcoind.summaryCache.set(keys[i], {}); + dashd.transactionDetailedCache.set(keys[i], {}); + dashd.utxosCache.set(keys[i], {}); + dashd.txidsCache.set(keys[i], {}); + dashd.balanceCache.set(keys[i], {}); + dashd.summaryCache.set(keys[i], {}); } - bitcoind._resetCaches(); - should.equal(bitcoind.transactionDetailedCache.get(keys[0]), undefined); - should.equal(bitcoind.utxosCache.get(keys[0]), undefined); - should.equal(bitcoind.txidsCache.get(keys[0]), undefined); - should.equal(bitcoind.balanceCache.get(keys[0]), undefined); - should.equal(bitcoind.summaryCache.get(keys[0]), undefined); + dashd._resetCaches(); + should.equal(dashd.transactionDetailedCache.get(keys[0]), undefined); + should.equal(dashd.utxosCache.get(keys[0]), undefined); + should.equal(dashd.txidsCache.get(keys[0]), undefined); + should.equal(dashd.balanceCache.get(keys[0]), undefined); + should.equal(dashd.summaryCache.get(keys[0]), undefined); }); }); describe('#_tryAllClients', function() { it('will retry for each node client', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.tryAllInterval = 1; - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.tryAllInterval = 1; + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('test')) } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('test')) } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArg(0) } }); - bitcoind._tryAllClients(function(client, next) { + dashd._tryAllClients(function(client, next) { client.getInfo(next); }, function(err) { if (err) { return done(err); } - bitcoind.nodes[0].client.getInfo.callCount.should.equal(1); - bitcoind.nodes[1].client.getInfo.callCount.should.equal(1); - bitcoind.nodes[2].client.getInfo.callCount.should.equal(1); + dashd.nodes[0].client.getInfo.callCount.should.equal(1); + dashd.nodes[1].client.getInfo.callCount.should.equal(1); + dashd.nodes[2].client.getInfo.callCount.should.equal(1); done(); }); }); it('will start using the current node index (round-robin)', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.tryAllInterval = 1; - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.tryAllInterval = 1; + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('2')) } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('3')) } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('1')) } }); - bitcoind.nodesIndex = 2; - bitcoind._tryAllClients(function(client, next) { + dashd.nodesIndex = 2; + dashd._tryAllClients(function(client, next) { client.getInfo(next); }, function(err) { err.should.be.instanceOf(Error); err.message.should.equal('3'); - bitcoind.nodes[0].client.getInfo.callCount.should.equal(1); - bitcoind.nodes[1].client.getInfo.callCount.should.equal(1); - bitcoind.nodes[2].client.getInfo.callCount.should.equal(1); - bitcoind.nodesIndex.should.equal(0); + dashd.nodes[0].client.getInfo.callCount.should.equal(1); + dashd.nodes[1].client.getInfo.callCount.should.equal(1); + dashd.nodes[2].client.getInfo.callCount.should.equal(1); + dashd.nodesIndex.should.equal(0); done(); }); }); it('will get error if all clients fail', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.tryAllInterval = 1; - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.tryAllInterval = 1; + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('test')) } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('test')) } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: sinon.stub().callsArgWith(0, new Error('test')) } }); - bitcoind._tryAllClients(function(client, next) { + dashd._tryAllClients(function(client, next) { client.getInfo(next); }, function(err) { should.exist(err); @@ -644,9 +644,9 @@ describe('Bitcoin Service', function() { }); describe('#_wrapRPCError', function() { - it('will convert bitcoind-rpc-dash error object into JavaScript error', function() { - var bitcoind = new BitcoinService(baseConfig); - var error = bitcoind._wrapRPCError({message: 'Test error', code: -1}); + it('will convert dashd-rpc object into JavaScript error', function() { + var dashd = new DashService(baseConfig); + var error = dashd._wrapRPCError({message: 'Test error', code: -1}); error.should.be.an.instanceof(errors.RPCError); error.code.should.equal(-1); error.message.should.equal('Test error'); @@ -662,10 +662,10 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will set height and genesis buffer', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var genesisBuffer = new Buffer([]); - bitcoind.getRawBlock = sinon.stub().callsArgWith(1, null, genesisBuffer); - bitcoind.nodes.push({ + dashd.getRawBlock = sinon.stub().callsArgWith(1, null, genesisBuffer); + dashd.nodes.push({ client: { getBestBlockHash: function(callback) { callback(null, { @@ -688,45 +688,45 @@ describe('Bitcoin Service', function() { } } }); - bitcoind._initChain(function() { + dashd._initChain(function() { log.info.callCount.should.equal(1); - bitcoind.getRawBlock.callCount.should.equal(1); - bitcoind.getRawBlock.args[0][0].should.equal('genesishash'); - bitcoind.height.should.equal(5000); - bitcoind.genesisBuffer.should.equal(genesisBuffer); + dashd.getRawBlock.callCount.should.equal(1); + dashd.getRawBlock.args[0][0].should.equal('genesishash'); + dashd.height.should.equal(5000); + dashd.genesisBuffer.should.equal(genesisBuffer); done(); }); }); it('it will handle error from getBestBlockHash', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, {code: -1, message: 'error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBestBlockHash: getBestBlockHash } }); - bitcoind._initChain(function(err) { + dashd._initChain(function(err) { err.should.be.instanceOf(Error); done(); }); }); it('it will handle error from getBlock', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, null, {}); var getBlock = sinon.stub().callsArgWith(1, {code: -1, message: 'error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBestBlockHash: getBestBlockHash, getBlock: getBlock } }); - bitcoind._initChain(function(err) { + dashd._initChain(function(err) { err.should.be.instanceOf(Error); done(); }); }); it('it will handle error from getBlockHash', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, null, {}); var getBlock = sinon.stub().callsArgWith(1, null, { result: { @@ -734,20 +734,20 @@ describe('Bitcoin Service', function() { } }); var getBlockHash = sinon.stub().callsArgWith(1, {code: -1, message: 'error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBestBlockHash: getBestBlockHash, getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind._initChain(function(err) { + dashd._initChain(function(err) { err.should.be.instanceOf(Error); done(); }); }); it('it will handle error from getRawBlock', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, null, {}); var getBlock = sinon.stub().callsArgWith(1, null, { result: { @@ -755,15 +755,15 @@ describe('Bitcoin Service', function() { } }); var getBlockHash = sinon.stub().callsArgWith(1, null, {}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBestBlockHash: getBestBlockHash, getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind.getRawBlock = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind._initChain(function(err) { + dashd.getRawBlock = sinon.stub().callsArgWith(1, new Error('test')); + dashd._initChain(function(err) { err.should.be.instanceOf(Error); done(); }); @@ -772,176 +772,176 @@ describe('Bitcoin Service', function() { describe('#_getDefaultConf', function() { afterEach(function() { - bitcore.Networks.disableRegtest(); - baseConfig.node.network = bitcore.Networks.testnet; + dashcore.Networks.disableRegtest(); + baseConfig.node.network = dashcore.Networks.testnet; }); it('will get default rpc port for livenet', function() { var config = { node: { - network: bitcore.Networks.livenet + network: dashcore.Networks.livenet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind._getDefaultConf().rpcport.should.equal(9998); + var dashd = new DashService(config); + dashd._getDefaultConf().rpcport.should.equal(9998); }); it('will get default rpc port for testnet', function() { var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind._getDefaultConf().rpcport.should.equal(19998); + var dashd = new DashService(config); + dashd._getDefaultConf().rpcport.should.equal(19998); }); it('will get default rpc port for regtest', function() { - bitcore.Networks.enableRegtest(); + dashcore.Networks.enableRegtest(); var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind._getDefaultConf().rpcport.should.equal(19998); + var dashd = new DashService(config); + dashd._getDefaultConf().rpcport.should.equal(19998); }); }); describe('#_getNetworkConfigPath', function() { afterEach(function() { - bitcore.Networks.disableRegtest(); - baseConfig.node.network = bitcore.Networks.testnet; + dashcore.Networks.disableRegtest(); + baseConfig.node.network = dashcore.Networks.testnet; }); it('will get default config path for livenet', function() { var config = { node: { - network: bitcore.Networks.livenet + network: dashcore.Networks.livenet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - should.equal(bitcoind._getNetworkConfigPath(), undefined); + var dashd = new DashService(config); + should.equal(dashd._getNetworkConfigPath(), undefined); }); it('will get default rpc port for testnet', function() { var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind._getNetworkConfigPath().should.equal('testnet3/dash.conf'); + var dashd = new DashService(config); + dashd._getNetworkConfigPath().should.equal('testnet3/dash.conf'); }); it('will get default rpc port for regtest', function() { - bitcore.Networks.enableRegtest(); + dashcore.Networks.enableRegtest(); var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind._getNetworkConfigPath().should.equal('regtest/dash.conf'); + var dashd = new DashService(config); + dashd._getNetworkConfigPath().should.equal('regtest/dash.conf'); }); }); describe('#_getNetworkOption', function() { afterEach(function() { - bitcore.Networks.disableRegtest(); - baseConfig.node.network = bitcore.Networks.testnet; + dashcore.Networks.disableRegtest(); + baseConfig.node.network = dashcore.Networks.testnet; }); it('return --testnet for testnet', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.node.network = bitcore.Networks.testnet; - bitcoind._getNetworkOption().should.equal('--testnet'); + var dashd = new DashService(baseConfig); + dashd.node.network = dashcore.Networks.testnet; + dashd._getNetworkOption().should.equal('--testnet'); }); it('return --regtest for testnet', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.node.network = bitcore.Networks.testnet; - bitcore.Networks.enableRegtest(); - bitcoind._getNetworkOption().should.equal('--regtest'); + var dashd = new DashService(baseConfig); + dashd.node.network = dashcore.Networks.testnet; + dashcore.Networks.enableRegtest(); + dashd._getNetworkOption().should.equal('--regtest'); }); it('return undefined for livenet', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.node.network = bitcore.Networks.livenet; - bitcore.Networks.enableRegtest(); - should.equal(bitcoind._getNetworkOption(), undefined); + var dashd = new DashService(baseConfig); + dashd.node.network = dashcore.Networks.livenet; + dashcore.Networks.enableRegtest(); + should.equal(dashd._getNetworkOption(), undefined); }); }); describe('#_zmqBlockHandler', function() { it('will emit block', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = {}; var message = new Buffer('00000000002e08fc7ae9a9aa5380e95e2adcdc5752a4a66a7d3a22466bd4e6aa', 'hex'); - bitcoind._rapidProtectedUpdateTip = sinon.stub(); - bitcoind.on('block', function(block) { + dashd._rapidProtectedUpdateTip = sinon.stub(); + dashd.on('block', function(block) { block.should.equal(message); done(); }); - bitcoind._zmqBlockHandler(node, message); + dashd._zmqBlockHandler(node, message); }); it('will not emit same block twice', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = {}; var message = new Buffer('00000000002e08fc7ae9a9aa5380e95e2adcdc5752a4a66a7d3a22466bd4e6aa', 'hex'); - bitcoind._rapidProtectedUpdateTip = sinon.stub(); - bitcoind.on('block', function(block) { + dashd._rapidProtectedUpdateTip = sinon.stub(); + dashd.on('block', function(block) { block.should.equal(message); done(); }); - bitcoind._zmqBlockHandler(node, message); - bitcoind._zmqBlockHandler(node, message); + dashd._zmqBlockHandler(node, message); + dashd._zmqBlockHandler(node, message); }); it('will call function to update tip', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = {}; var message = new Buffer('00000000002e08fc7ae9a9aa5380e95e2adcdc5752a4a66a7d3a22466bd4e6aa', 'hex'); - bitcoind._rapidProtectedUpdateTip = sinon.stub(); - bitcoind._zmqBlockHandler(node, message); - bitcoind._rapidProtectedUpdateTip.callCount.should.equal(1); - bitcoind._rapidProtectedUpdateTip.args[0][0].should.equal(node); - bitcoind._rapidProtectedUpdateTip.args[0][1].should.equal(message); + dashd._rapidProtectedUpdateTip = sinon.stub(); + dashd._zmqBlockHandler(node, message); + dashd._rapidProtectedUpdateTip.callCount.should.equal(1); + dashd._rapidProtectedUpdateTip.args[0][0].should.equal(node); + dashd._rapidProtectedUpdateTip.args[0][1].should.equal(message); }); it('will emit to subscribers', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = {}; var message = new Buffer('00000000002e08fc7ae9a9aa5380e95e2adcdc5752a4a66a7d3a22466bd4e6aa', 'hex'); - bitcoind._rapidProtectedUpdateTip = sinon.stub(); + dashd._rapidProtectedUpdateTip = sinon.stub(); var emitter = new EventEmitter(); - bitcoind.subscriptions.hashblock.push(emitter); - emitter.on('bitcoind/hashblock', function(blockHash) { + dashd.subscriptions.hashblock.push(emitter); + emitter.on('dashd/hashblock', function(blockHash) { blockHash.should.equal(message.toString('hex')); done(); }); - bitcoind._zmqBlockHandler(node, message); + dashd._zmqBlockHandler(node, message); }); }); describe('#_rapidProtectedUpdateTip', function() { it('will limit tip updates with rapid calls', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var callCount = 0; - bitcoind._updateTip = function() { + dashd._updateTip = function() { callCount++; callCount.should.be.within(1, 2); if (callCount > 1) { @@ -952,7 +952,7 @@ describe('Bitcoin Service', function() { var message = new Buffer('00000000002e08fc7ae9a9aa5380e95e2adcdc5752a4a66a7d3a22466bd4e6aa', 'hex'); var count = 0; function repeat() { - bitcoind._rapidProtectedUpdateTip(node, message); + dashd._rapidProtectedUpdateTip(node, message); count++; if (count < 50) { repeat(); @@ -973,9 +973,9 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('log and emit rpc error from get block', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub(); - bitcoind.on('error', function(err) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub(); + dashd.on('error', function(err) { err.code.should.equal(-1); err.message.should.equal('Test error'); log.error.callCount.should.equal(1); @@ -986,12 +986,12 @@ describe('Bitcoin Service', function() { getBlock: sinon.stub().callsArgWith(1, {message: 'Test error', code: -1}) } }; - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); }); it('emit synced if percentage is 100', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, null, 100); - bitcoind.on('synced', function() { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, null, 100); + dashd.on('synced', function() { done(); }); var node = { @@ -999,12 +999,12 @@ describe('Bitcoin Service', function() { getBlock: sinon.stub() } }; - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); }); it('NOT emit synced if percentage is less than 100', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, null, 99); - bitcoind.on('synced', function() { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, null, 99); + dashd.on('synced', function() { throw new Error('Synced called'); }); var node = { @@ -1012,14 +1012,14 @@ describe('Bitcoin Service', function() { getBlock: sinon.stub() } }; - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); log.info.callCount.should.equal(1); done(); }); it('log and emit error from syncPercentage', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, new Error('test')); - bitcoind.on('error', function(err) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, new Error('test')); + dashd.on('error', function(err) { log.error.callCount.should.equal(1); err.message.should.equal('test'); done(); @@ -1029,16 +1029,16 @@ describe('Bitcoin Service', function() { getBlock: sinon.stub() } }; - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); }); it('reset caches and set height', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub(); - bitcoind._resetCaches = sinon.stub(); - bitcoind.on('tip', function(height) { - bitcoind._resetCaches.callCount.should.equal(1); + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub(); + dashd._resetCaches = sinon.stub(); + dashd.on('tip', function(height) { + dashd._resetCaches.callCount.should.equal(1); height.should.equal(10); - bitcoind.height.should.equal(10); + dashd.height.should.equal(10); done(); }); var node = { @@ -1050,13 +1050,13 @@ describe('Bitcoin Service', function() { }) } }; - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); }); it('will NOT update twice for the same hash', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub(); - bitcoind._resetCaches = sinon.stub(); - bitcoind.on('tip', function() { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub(); + dashd._resetCaches = sinon.stub(); + dashd.on('tip', function() { done(); }); var node = { @@ -1068,23 +1068,23 @@ describe('Bitcoin Service', function() { }) } }; - bitcoind._updateTip(node, message); - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); + dashd._updateTip(node, message); }); it('will not call syncPercentage if node is stopping', function(done) { var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind.syncPercentage = sinon.stub(); - bitcoind._resetCaches = sinon.stub(); - bitcoind.node.stopping = true; + var dashd = new DashService(config); + dashd.syncPercentage = sinon.stub(); + dashd._resetCaches = sinon.stub(); + dashd.node.stopping = true; var node = { client: { getBlock: sinon.stub().callsArgWith(1, null, { @@ -1094,209 +1094,209 @@ describe('Bitcoin Service', function() { }) } }; - bitcoind.on('tip', function() { - bitcoind.syncPercentage.callCount.should.equal(0); + dashd.on('tip', function() { + dashd.syncPercentage.callCount.should.equal(0); done(); }); - bitcoind._updateTip(node, message); + dashd._updateTip(node, message); }); }); describe('#_getAddressesFromTransaction', function() { - it('will get results using bitcore.Transaction', function() { - var bitcoind = new BitcoinService(baseConfig); + it('will get results using dashcore.Transaction', function() { + var dashd = new DashService(baseConfig); var wif = 'XGLgPK8gbmzU7jcbw34Pj55AXV7SmG6carKuiwtu4WtvTjyTbpwX'; - var privkey = bitcore.PrivateKey.fromWIF(wif); - var inputAddress = privkey.toAddress(bitcore.Networks.testnet); - var outputAddress = bitcore.Address('8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'); - var tx = bitcore.Transaction(); + var privkey = dashcore.PrivateKey.fromWIF(wif); + var inputAddress = privkey.toAddress(dashcore.Networks.testnet); + var outputAddress = dashcore.Address('8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'); + var tx = dashcore.Transaction(); tx.from({ txid: '4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b', outputIndex: 0, - script: bitcore.Script(inputAddress), + script: dashcore.Script(inputAddress), address: inputAddress.toString(), satoshis: 5000000000 }); tx.to(outputAddress, 5000000000); tx.sign(privkey); - var addresses = bitcoind._getAddressesFromTransaction(tx); + var addresses = dashd._getAddressesFromTransaction(tx); addresses.length.should.equal(2); addresses[0].should.equal(inputAddress.toString()); addresses[1].should.equal(outputAddress.toString()); }); it('will handle non-standard script types', function() { - var bitcoind = new BitcoinService(baseConfig); - var tx = bitcore.Transaction(); - tx.addInput(bitcore.Transaction.Input({ + var dashd = new DashService(baseConfig); + var tx = dashcore.Transaction(); + tx.addInput(dashcore.Transaction.Input({ prevTxId: '4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b', - script: bitcore.Script('OP_TRUE'), + script: dashcore.Script('OP_TRUE'), outputIndex: 1, output: { - script: bitcore.Script('OP_TRUE'), + script: dashcore.Script('OP_TRUE'), satoshis: 5000000000 } })); - tx.addOutput(bitcore.Transaction.Output({ - script: bitcore.Script('OP_TRUE'), + tx.addOutput(dashcore.Transaction.Output({ + script: dashcore.Script('OP_TRUE'), satoshis: 5000000000 })); - var addresses = bitcoind._getAddressesFromTransaction(tx); + var addresses = dashd._getAddressesFromTransaction(tx); addresses.length.should.equal(0); }); it('will handle unparsable script types or missing input script', function() { - var bitcoind = new BitcoinService(baseConfig); - var tx = bitcore.Transaction(); - tx.addOutput(bitcore.Transaction.Output({ + var dashd = new DashService(baseConfig); + var tx = dashcore.Transaction(); + tx.addOutput(dashcore.Transaction.Output({ script: new Buffer('4c', 'hex'), satoshis: 5000000000 })); - var addresses = bitcoind._getAddressesFromTransaction(tx); + var addresses = dashd._getAddressesFromTransaction(tx); addresses.length.should.equal(0); }); it('will return unique values', function() { - var bitcoind = new BitcoinService(baseConfig); - var tx = bitcore.Transaction(); - var address = bitcore.Address('8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'); - tx.addOutput(bitcore.Transaction.Output({ - script: bitcore.Script(address), + var dashd = new DashService(baseConfig); + var tx = dashcore.Transaction(); + var address = dashcore.Address('8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi'); + tx.addOutput(dashcore.Transaction.Output({ + script: dashcore.Script(address), satoshis: 5000000000 })); - tx.addOutput(bitcore.Transaction.Output({ - script: bitcore.Script(address), + tx.addOutput(dashcore.Transaction.Output({ + script: dashcore.Script(address), satoshis: 5000000000 })); - var addresses = bitcoind._getAddressesFromTransaction(tx); + var addresses = dashd._getAddressesFromTransaction(tx); addresses.length.should.equal(1); }); }); describe('#_notifyAddressTxidSubscribers', function() { it('will emit event if matching addresses', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind._getAddressesFromTransaction = sinon.stub().returns([address]); + dashd._getAddressesFromTransaction = sinon.stub().returns([address]); var emitter = new EventEmitter(); - bitcoind.subscriptions.address[address] = [emitter]; + dashd.subscriptions.address[address] = [emitter]; var txid = '46f24e0c274fc07708b781963576c4c5d5625d926dbb0a17fa865dcd9fe58ea0'; var transaction = {}; - emitter.on('bitcoind/addresstxid', function(data) { + emitter.on('dashd/addresstxid', function(data) { data.address.should.equal(address); data.txid.should.equal(txid); done(); }); sinon.spy(emitter, 'emit'); - bitcoind._notifyAddressTxidSubscribers(txid, transaction); + dashd._notifyAddressTxidSubscribers(txid, transaction); emitter.emit.callCount.should.equal(1); }); it('will NOT emit event without matching addresses', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind._getAddressesFromTransaction = sinon.stub().returns([address]); + dashd._getAddressesFromTransaction = sinon.stub().returns([address]); var emitter = new EventEmitter(); var txid = '46f24e0c274fc07708b781963576c4c5d5625d926dbb0a17fa865dcd9fe58ea0'; var transaction = {}; emitter.emit = sinon.stub(); - bitcoind._notifyAddressTxidSubscribers(txid, transaction); + dashd._notifyAddressTxidSubscribers(txid, transaction); emitter.emit.callCount.should.equal(0); }); }); describe('#_zmqTransactionHandler', function() { it('will emit to subscribers', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); var emitter = new EventEmitter(); - bitcoind.subscriptions.rawtransaction.push(emitter); - emitter.on('bitcoind/rawtransaction', function(hex) { + dashd.subscriptions.rawtransaction.push(emitter); + emitter.on('dashd/rawtransaction', function(hex) { hex.should.be.a('string'); hex.should.equal(expectedBuffer.toString('hex')); done(); }); var node = {}; - bitcoind._zmqTransactionHandler(node, expectedBuffer); + dashd._zmqTransactionHandler(node, expectedBuffer); }); it('will NOT emit to subscribers more than once for the same tx', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); var emitter = new EventEmitter(); - bitcoind.subscriptions.rawtransaction.push(emitter); - emitter.on('bitcoind/rawtransaction', function() { + dashd.subscriptions.rawtransaction.push(emitter); + emitter.on('dashd/rawtransaction', function() { done(); }); var node = {}; - bitcoind._zmqTransactionHandler(node, expectedBuffer); - bitcoind._zmqTransactionHandler(node, expectedBuffer); + dashd._zmqTransactionHandler(node, expectedBuffer); + dashd._zmqTransactionHandler(node, expectedBuffer); }); it('will emit "tx" event', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); - bitcoind.on('tx', function(buffer) { + dashd.on('tx', function(buffer) { buffer.should.be.instanceof(Buffer); buffer.toString('hex').should.equal(expectedBuffer.toString('hex')); done(); }); var node = {}; - bitcoind._zmqTransactionHandler(node, expectedBuffer); + dashd._zmqTransactionHandler(node, expectedBuffer); }); it('will NOT emit "tx" event more than once for the same tx', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); - bitcoind.on('tx', function() { + dashd.on('tx', function() { done(); }); var node = {}; - bitcoind._zmqTransactionHandler(node, expectedBuffer); - bitcoind._zmqTransactionHandler(node, expectedBuffer); + dashd._zmqTransactionHandler(node, expectedBuffer); + dashd._zmqTransactionHandler(node, expectedBuffer); }); }); // TODO: transaction lock test coverage describe('#_zmqTransactionLockHandler', function() { it('will emit to subscribers', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); var emitter = new EventEmitter(); - bitcoind.subscriptions.transactionlock.push(emitter); - emitter.on('bitcoind/transactionlock', function(hex) { + dashd.subscriptions.transactionlock.push(emitter); + emitter.on('dashd/transactionlock', function(hex) { hex.should.be.a('string'); hex.should.equal(expectedBuffer.toString('hex')); done(); }); var node = {}; - bitcoind._zmqTransactionLockHandler(node, expectedBuffer); + dashd._zmqTransactionLockHandler(node, expectedBuffer); }); it('will NOT emit to subscribers more than once for the same tx', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); var emitter = new EventEmitter(); - bitcoind.subscriptions.transactionlock.push(emitter); - emitter.on('bitcoind/transactionlock', function() { + dashd.subscriptions.transactionlock.push(emitter); + emitter.on('dashd/transactionlock', function() { done(); }); var node = {}; - bitcoind._zmqTransactionLockHandler(node, expectedBuffer); - bitcoind._zmqTransactionLockHandler(node, expectedBuffer); + dashd._zmqTransactionLockHandler(node, expectedBuffer); + dashd._zmqTransactionLockHandler(node, expectedBuffer); }); it('will emit "tx" event', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); - bitcoind.on('txlock', function(buffer) { + dashd.on('txlock', function(buffer) { buffer.should.be.instanceof(Buffer); buffer.toString('hex').should.equal(expectedBuffer.toString('hex')); done(); }); var node = {}; - bitcoind._zmqTransactionLockHandler(node, expectedBuffer); + dashd._zmqTransactionLockHandler(node, expectedBuffer); }); it('will NOT emit "tx" event more than once for the same tx', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedBuffer = new Buffer(txhex, 'hex'); - bitcoind.on('txlock', function() { + dashd.on('txlock', function() { done(); }); var node = {}; - bitcoind._zmqTransactionLockHandler(node, expectedBuffer); - bitcoind._zmqTransactionLockHandler(node, expectedBuffer); + dashd._zmqTransactionLockHandler(node, expectedBuffer); + dashd._zmqTransactionLockHandler(node, expectedBuffer); }); }); @@ -1309,11 +1309,11 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('log errors, update tip and subscribe to zmq events', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._updateTip = sinon.stub(); - bitcoind._subscribeZmqEvents = sinon.stub(); + var dashd = new DashService(baseConfig); + dashd._updateTip = sinon.stub(); + dashd._subscribeZmqEvents = sinon.stub(); var blockEvents = 0; - bitcoind.on('block', function() { + dashd.on('block', function() { blockEvents++; }); var getBestBlockHash = sinon.stub().callsArgWith(0, null, { @@ -1344,26 +1344,26 @@ describe('Bitcoin Service', function() { getBlockchainInfo: getBlockchainInfo } }; - bitcoind._checkSyncedAndSubscribeZmqEvents(node); + dashd._checkSyncedAndSubscribeZmqEvents(node); setTimeout(function() { log.error.callCount.should.equal(2); blockEvents.should.equal(11); - bitcoind._updateTip.callCount.should.equal(11); - bitcoind._subscribeZmqEvents.callCount.should.equal(1); + dashd._updateTip.callCount.should.equal(11); + dashd._subscribeZmqEvents.callCount.should.equal(1); done(); }, 200); }); it('it will clear interval if node is stopping', function(done) { var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); + var dashd = new DashService(config); var getBestBlockHash = sinon.stub().callsArgWith(0, {code: -1, message: 'error'}); var node = { _tipUpdateInterval: 1, @@ -1371,9 +1371,9 @@ describe('Bitcoin Service', function() { getBestBlockHash: getBestBlockHash } }; - bitcoind._checkSyncedAndSubscribeZmqEvents(node); + dashd._checkSyncedAndSubscribeZmqEvents(node); setTimeout(function() { - bitcoind.node.stopping = true; + dashd.node.stopping = true; var count = getBestBlockHash.callCount; setTimeout(function() { getBestBlockHash.callCount.should.equal(count); @@ -1382,9 +1382,9 @@ describe('Bitcoin Service', function() { }, 100); }); it('will not set interval if synced is true', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._updateTip = sinon.stub(); - bitcoind._subscribeZmqEvents = sinon.stub(); + var dashd = new DashService(baseConfig); + dashd._updateTip = sinon.stub(); + dashd._subscribeZmqEvents = sinon.stub(); var getBestBlockHash = sinon.stub().callsArgWith(0, null, { result: '00000000000000001bb82a7f5973618cfd3185ba1ded04dd852a653f92a27c45' }); @@ -1401,7 +1401,7 @@ describe('Bitcoin Service', function() { getBlockchainInfo: getBlockchainInfo } }; - bitcoind._checkSyncedAndSubscribeZmqEvents(node); + dashd._checkSyncedAndSubscribeZmqEvents(node); setTimeout(function() { getBestBlockHash.callCount.should.equal(1); getBlockchainInfo.callCount.should.equal(1); @@ -1412,29 +1412,29 @@ describe('Bitcoin Service', function() { describe('#_subscribeZmqEvents', function() { it('will call subscribe on zmq socket', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = { zmqSubSocket: { subscribe: sinon.stub(), on: sinon.stub() } }; - bitcoind._subscribeZmqEvents(node); + dashd._subscribeZmqEvents(node); node.zmqSubSocket.subscribe.callCount.should.equal(3); node.zmqSubSocket.subscribe.args[0][0].should.equal('hashblock'); node.zmqSubSocket.subscribe.args[1][0].should.equal('rawtx'); node.zmqSubSocket.subscribe.args[2][0].should.equal('rawtxlock'); }); it('will call relevant handler for rawtx topics', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._zmqTransactionHandler = sinon.stub(); + var dashd = new DashService(baseConfig); + dashd._zmqTransactionHandler = sinon.stub(); var node = { zmqSubSocket: new EventEmitter() }; node.zmqSubSocket.subscribe = sinon.stub(); - bitcoind._subscribeZmqEvents(node); + dashd._subscribeZmqEvents(node); node.zmqSubSocket.on('message', function() { - bitcoind._zmqTransactionHandler.callCount.should.equal(1); + dashd._zmqTransactionHandler.callCount.should.equal(1); done(); }); var topic = new Buffer('rawtx', 'utf8'); @@ -1442,15 +1442,15 @@ describe('Bitcoin Service', function() { node.zmqSubSocket.emit('message', topic, message); }); it('will call relevant handler for hashblock topics', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._zmqBlockHandler = sinon.stub(); + var dashd = new DashService(baseConfig); + dashd._zmqBlockHandler = sinon.stub(); var node = { zmqSubSocket: new EventEmitter() }; node.zmqSubSocket.subscribe = sinon.stub(); - bitcoind._subscribeZmqEvents(node); + dashd._subscribeZmqEvents(node); node.zmqSubSocket.on('message', function() { - bitcoind._zmqBlockHandler.callCount.should.equal(1); + dashd._zmqBlockHandler.callCount.should.equal(1); done(); }); var topic = new Buffer('hashblock', 'utf8'); @@ -1458,17 +1458,17 @@ describe('Bitcoin Service', function() { node.zmqSubSocket.emit('message', topic, message); }); it('will ignore unknown topic types', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._zmqBlockHandler = sinon.stub(); - bitcoind._zmqTransactionHandler = sinon.stub(); + var dashd = new DashService(baseConfig); + dashd._zmqBlockHandler = sinon.stub(); + dashd._zmqTransactionHandler = sinon.stub(); var node = { zmqSubSocket: new EventEmitter() }; node.zmqSubSocket.subscribe = sinon.stub(); - bitcoind._subscribeZmqEvents(node); + dashd._subscribeZmqEvents(node); node.zmqSubSocket.on('message', function() { - bitcoind._zmqBlockHandler.callCount.should.equal(0); - bitcoind._zmqTransactionHandler.callCount.should.equal(0); + dashd._zmqBlockHandler.callCount.should.equal(0); + dashd._zmqTransactionHandler.callCount.should.equal(0); done(); }); var topic = new Buffer('unknown', 'utf8'); @@ -1485,14 +1485,14 @@ describe('Bitcoin Service', function() { var socketFunc = function() { return socket; }; - var BitcoinService = proxyquire('../../lib/services/bitcoind', { + var DashService = proxyquire('../../lib/services/dashd', { zmq: { socket: socketFunc } }); - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = {}; - bitcoind._initZmqSubSocket(node, 'url'); + dashd._initZmqSubSocket(node, 'url'); node.zmqSubSocket.should.equal(socket); socket.connect.callCount.should.equal(1); socket.connect.args[0][0].should.equal('url'); @@ -1511,7 +1511,7 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('give error from client getblockchaininfo', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = { _reindex: true, _reindexWait: 1, @@ -1519,14 +1519,14 @@ describe('Bitcoin Service', function() { getBlockchainInfo: sinon.stub().callsArgWith(0, {code: -1 , message: 'Test error'}) } }; - bitcoind._checkReindex(node, function(err) { + dashd._checkReindex(node, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); done(); }); }); it('will wait until sync is 100 percent', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var percent = 0.89; var node = { _reindex: true, @@ -1542,18 +1542,18 @@ describe('Bitcoin Service', function() { } } }; - bitcoind._checkReindex(node, function() { + dashd._checkReindex(node, function() { node._reindex.should.equal(false); log.info.callCount.should.equal(11); done(); }); }); it('will call callback if reindex is not enabled', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = { _reindex: false }; - bitcoind._checkReindex(node, function() { + dashd._checkReindex(node, function() { node._reindex.should.equal(false); done(); }); @@ -1569,21 +1569,21 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will give rpc from client getbestblockhash', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, {code: -1, message: 'Test error'}); var node = { client: { getBestBlockHash: getBestBlockHash } }; - bitcoind._loadTipFromNode(node, function(err) { + dashd._loadTipFromNode(node, function(err) { err.should.be.instanceof(Error); log.warn.callCount.should.equal(0); done(); }); }); it('will give rpc from client getblock', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, null, { result: '00000000000000001bb82a7f5973618cfd3185ba1ded04dd852a653f92a27c45' }); @@ -1594,7 +1594,7 @@ describe('Bitcoin Service', function() { getBlock: getBlock } }; - bitcoind._loadTipFromNode(node, function(err) { + dashd._loadTipFromNode(node, function(err) { getBlock.args[0][0].should.equal('00000000000000001bb82a7f5973618cfd3185ba1ded04dd852a653f92a27c45'); err.should.be.instanceof(Error); log.warn.callCount.should.equal(0); @@ -1602,21 +1602,21 @@ describe('Bitcoin Service', function() { }); }); it('will log when error is RPC_IN_WARMUP', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, {code: -28, message: 'Verifying blocks...'}); var node = { client: { getBestBlockHash: getBestBlockHash } }; - bitcoind._loadTipFromNode(node, function(err) { + dashd._loadTipFromNode(node, function(err) { err.should.be.instanceof(Error); log.warn.callCount.should.equal(1); done(); }); }); it('will set height and emit tip', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, null, { result: '00000000000000001bb82a7f5973618cfd3185ba1ded04dd852a653f92a27c45' }); @@ -1631,12 +1631,12 @@ describe('Bitcoin Service', function() { getBlock: getBlock } }; - bitcoind.on('tip', function(height) { + dashd.on('tip', function(height) { height.should.equal(100); - bitcoind.height.should.equal(100); + dashd.height.should.equal(100); done(); }); - bitcoind._loadTipFromNode(node, function(err) { + dashd._loadTipFromNode(node, function(err) { if (err) { return done(err); } @@ -1658,20 +1658,20 @@ describe('Bitcoin Service', function() { var error = new Error('Test error'); error.code = 'ENOENT'; readFile.onCall(1).callsArgWith(2, error); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFile: readFile } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind.spawnStopTime = 1; - bitcoind._process = {}; - bitcoind._process.kill = sinon.stub(); - bitcoind._stopSpawnedBitcoin(function(err) { + var dashd = new TestDashService(baseConfig); + dashd.spawnStopTime = 1; + dashd._process = {}; + dashd._process.kill = sinon.stub(); + dashd._stopSpawnedDash(function(err) { if (err) { return done(err); } - bitcoind._process.kill.callCount.should.equal(1); + dashd._process.kill.callCount.should.equal(1); log.warn.callCount.should.equal(1); done(); }); @@ -1682,22 +1682,22 @@ describe('Bitcoin Service', function() { var error = new Error('Test error'); error.code = 'ENOENT'; readFile.onCall(1).callsArgWith(2, error); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFile: readFile } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind.spawnStopTime = 1; - bitcoind._process = {}; + var dashd = new TestDashService(baseConfig); + dashd.spawnStopTime = 1; + dashd._process = {}; var error2 = new Error('Test error'); error2.code = 'ESRCH'; - bitcoind._process.kill = sinon.stub().throws(error2); - bitcoind._stopSpawnedBitcoin(function(err) { + dashd._process.kill = sinon.stub().throws(error2); + dashd._stopSpawnedDash(function(err) { if (err) { return done(err); } - bitcoind._process.kill.callCount.should.equal(1); + dashd._process.kill.callCount.should.equal(1); log.warn.callCount.should.equal(2); done(); }); @@ -1705,16 +1705,16 @@ describe('Bitcoin Service', function() { it('it will attempt to kill process with NaN', function(done) { var readFile = sandbox.stub(); readFile.onCall(0).callsArgWith(2, null, ' '); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFile: readFile } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind.spawnStopTime = 1; - bitcoind._process = {}; - bitcoind._process.kill = sinon.stub(); - bitcoind._stopSpawnedBitcoin(function(err) { + var dashd = new TestDashService(baseConfig); + dashd.spawnStopTime = 1; + dashd._process = {}; + dashd._process.kill = sinon.stub(); + dashd._stopSpawnedDash(function(err) { if (err) { return done(err); } @@ -1724,16 +1724,16 @@ describe('Bitcoin Service', function() { it('it will attempt to kill process without pid', function(done) { var readFile = sandbox.stub(); readFile.onCall(0).callsArgWith(2, null, ''); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFile: readFile } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind.spawnStopTime = 1; - bitcoind._process = {}; - bitcoind._process.kill = sinon.stub(); - bitcoind._stopSpawnedBitcoin(function(err) { + var dashd = new TestDashService(baseConfig); + dashd.spawnStopTime = 1; + dashd._process = {}; + dashd._process.kill = sinon.stub(); + dashd._stopSpawnedDash(function(err) { if (err) { return done(err); } @@ -1753,20 +1753,20 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will give error from spawn config', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind._loadSpawnConfiguration = sinon.stub().throws(new Error('test')); - bitcoind._spawnChildProcess(function(err) { + var dashd = new DashService(baseConfig); + dashd._loadSpawnConfiguration = sinon.stub(); + dashd._loadSpawnConfiguration = sinon.stub().throws(new Error('test')); + dashd._spawnChildProcess(function(err) { err.should.be.instanceof(Error); err.message.should.equal('test'); done(); }); }); - it('will give error from stopSpawnedBitcoin', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind._stopSpawnedBitcoin = sinon.stub().callsArgWith(0, new Error('test')); - bitcoind._spawnChildProcess(function(err) { + it('will give error from stopSpawnedDash', function() { + var dashd = new DashService(baseConfig); + dashd._loadSpawnConfiguration = sinon.stub(); + dashd._stopSpawnedDash = sinon.stub().callsArgWith(0, new Error('test')); + dashd._spawnChildProcess(function(err) { err.should.be.instanceOf(Error); err.message.should.equal('test'); }); @@ -1774,7 +1774,7 @@ describe('Bitcoin Service', function() { it('will exit spawn if shutdown', function() { var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', @@ -1783,7 +1783,7 @@ describe('Bitcoin Service', function() { }; var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -1791,12 +1791,12 @@ describe('Bitcoin Service', function() { spawn: spawn } }); - var bitcoind = new TestBitcoinService(config); - bitcoind.spawn = {}; - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind._stopSpawnedBitcoin = sinon.stub().callsArgWith(0, null); - bitcoind.node.stopping = true; - bitcoind._spawnChildProcess(function(err) { + var dashd = new TestDashService(config); + dashd.spawn = {}; + dashd._loadSpawnConfiguration = sinon.stub(); + dashd._stopSpawnedDash = sinon.stub().callsArgWith(0, null); + dashd.node.stopping = true; + dashd._spawnChildProcess(function(err) { err.should.be.instanceOf(Error); err.message.should.match(/Stopping while trying to spawn/); }); @@ -1804,7 +1804,7 @@ describe('Bitcoin Service', function() { it('will include network with spawn command and init zmq/rpc on node', function(done) { var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -1812,51 +1812,51 @@ describe('Bitcoin Service', function() { spawn: spawn } }); - var bitcoind = new TestBitcoinService(baseConfig); + var dashd = new TestDashService(baseConfig); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind.spawn = {}; - bitcoind.spawn.exec = 'testexec'; - bitcoind.spawn.configPath = 'testdir/bitcoin.conf'; - bitcoind.spawn.datadir = 'testdir'; - bitcoind.spawn.config = {}; - bitcoind.spawn.config.rpcport = 20001; - bitcoind.spawn.config.rpcuser = 'bitcoin'; - bitcoind.spawn.config.rpcpassword = 'password'; - bitcoind.spawn.config.zmqpubrawtx = 'tcp://127.0.0.1:30001'; - bitcoind.spawn.config.zmqpubrawtxlock = 'tcp://127.0.0.1:30001'; + dashd._loadSpawnConfiguration = sinon.stub(); + dashd.spawn = {}; + dashd.spawn.exec = 'testexec'; + dashd.spawn.configPath = 'testdir/dash.conf'; + dashd.spawn.datadir = 'testdir'; + dashd.spawn.config = {}; + dashd.spawn.config.rpcport = 20001; + dashd.spawn.config.rpcuser = 'dash'; + dashd.spawn.config.rpcpassword = 'password'; + dashd.spawn.config.zmqpubrawtx = 'tcp://127.0.0.1:30001'; + dashd.spawn.config.zmqpubrawtxlock = 'tcp://127.0.0.1:30001'; - bitcoind._loadTipFromNode = sinon.stub().callsArgWith(1, null); - bitcoind._initZmqSubSocket = sinon.stub(); - bitcoind._checkSyncedAndSubscribeZmqEvents = sinon.stub(); - bitcoind._checkReindex = sinon.stub().callsArgWith(1, null); - bitcoind._spawnChildProcess(function(err, node) { + dashd._loadTipFromNode = sinon.stub().callsArgWith(1, null); + dashd._initZmqSubSocket = sinon.stub(); + dashd._checkSyncedAndSubscribeZmqEvents = sinon.stub(); + dashd._checkReindex = sinon.stub().callsArgWith(1, null); + dashd._spawnChildProcess(function(err, node) { should.not.exist(err); spawn.callCount.should.equal(1); spawn.args[0][0].should.equal('testexec'); spawn.args[0][1].should.deep.equal([ - '--conf=testdir/bitcoin.conf', + '--conf=testdir/dash.conf', '--datadir=testdir', '--testnet' ]); spawn.args[0][2].should.deep.equal({ stdio: 'inherit' }); - bitcoind._loadTipFromNode.callCount.should.equal(1); - bitcoind._initZmqSubSocket.callCount.should.equal(1); - should.exist(bitcoind._initZmqSubSocket.args[0][0].client); - bitcoind._initZmqSubSocket.args[0][1].should.equal('tcp://127.0.0.1:30001'); - bitcoind._checkSyncedAndSubscribeZmqEvents.callCount.should.equal(1); - should.exist(bitcoind._checkSyncedAndSubscribeZmqEvents.args[0][0].client); + dashd._loadTipFromNode.callCount.should.equal(1); + dashd._initZmqSubSocket.callCount.should.equal(1); + should.exist(dashd._initZmqSubSocket.args[0][0].client); + dashd._initZmqSubSocket.args[0][1].should.equal('tcp://127.0.0.1:30001'); + dashd._checkSyncedAndSubscribeZmqEvents.callCount.should.equal(1); + should.exist(dashd._checkSyncedAndSubscribeZmqEvents.args[0][0].client); should.exist(node); should.exist(node.client); done(); }); }); - it('will respawn bitcoind spawned process', function(done) { + it('will respawn dashd spawned process', function(done) { var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -1864,27 +1864,27 @@ describe('Bitcoin Service', function() { spawn: spawn } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind.spawn = {}; - bitcoind.spawn.exec = 'bitcoind'; - bitcoind.spawn.datadir = '/tmp/bitcoin'; - bitcoind.spawn.configPath = '/tmp/bitcoin/bitcoin.conf'; - bitcoind.spawn.config = {}; - bitcoind.spawnRestartTime = 1; - bitcoind._loadTipFromNode = sinon.stub().callsArg(1); - bitcoind._initZmqSubSocket = sinon.stub(); - bitcoind._checkReindex = sinon.stub().callsArg(1); - bitcoind._checkSyncedAndSubscribeZmqEvents = sinon.stub(); - bitcoind._stopSpawnedBitcoin = sinon.stub().callsArg(0); - sinon.spy(bitcoind, '_spawnChildProcess'); - bitcoind._spawnChildProcess(function(err) { + var dashd = new TestDashService(baseConfig); + dashd._loadSpawnConfiguration = sinon.stub(); + dashd.spawn = {}; + dashd.spawn.exec = 'dashd'; + dashd.spawn.datadir = '/tmp/dash'; + dashd.spawn.configPath = '/tmp/dash/dash.conf'; + dashd.spawn.config = {}; + dashd.spawnRestartTime = 1; + dashd._loadTipFromNode = sinon.stub().callsArg(1); + dashd._initZmqSubSocket = sinon.stub(); + dashd._checkReindex = sinon.stub().callsArg(1); + dashd._checkSyncedAndSubscribeZmqEvents = sinon.stub(); + dashd._stopSpawnedDash = sinon.stub().callsArg(0); + sinon.spy(dashd, '_spawnChildProcess'); + dashd._spawnChildProcess(function(err) { if (err) { return done(err); } process.once('exit', function() { setTimeout(function() { - bitcoind._spawnChildProcess.callCount.should.equal(2); + dashd._spawnChildProcess.callCount.should.equal(2); done(); }, 5); }); @@ -1894,7 +1894,7 @@ describe('Bitcoin Service', function() { it('will emit error during respawn', function(done) { var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -1902,26 +1902,26 @@ describe('Bitcoin Service', function() { spawn: spawn } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind.spawn = {}; - bitcoind.spawn.exec = 'bitcoind'; - bitcoind.spawn.datadir = '/tmp/bitcoin'; - bitcoind.spawn.configPath = '/tmp/bitcoin/bitcoin.conf'; - bitcoind.spawn.config = {}; - bitcoind.spawnRestartTime = 1; - bitcoind._loadTipFromNode = sinon.stub().callsArg(1); - bitcoind._initZmqSubSocket = sinon.stub(); - bitcoind._checkReindex = sinon.stub().callsArg(1); - bitcoind._checkSyncedAndSubscribeZmqEvents = sinon.stub(); - bitcoind._stopSpawnedBitcoin = sinon.stub().callsArg(0); - sinon.spy(bitcoind, '_spawnChildProcess'); - bitcoind._spawnChildProcess(function(err) { + var dashd = new TestDashService(baseConfig); + dashd._loadSpawnConfiguration = sinon.stub(); + dashd.spawn = {}; + dashd.spawn.exec = 'dashd'; + dashd.spawn.datadir = '/tmp/dash'; + dashd.spawn.configPath = '/tmp/dash/dash.conf'; + dashd.spawn.config = {}; + dashd.spawnRestartTime = 1; + dashd._loadTipFromNode = sinon.stub().callsArg(1); + dashd._initZmqSubSocket = sinon.stub(); + dashd._checkReindex = sinon.stub().callsArg(1); + dashd._checkSyncedAndSubscribeZmqEvents = sinon.stub(); + dashd._stopSpawnedDash = sinon.stub().callsArg(0); + sinon.spy(dashd, '_spawnChildProcess'); + dashd._spawnChildProcess(function(err) { if (err) { return done(err); } - bitcoind._spawnChildProcess = sinon.stub().callsArgWith(0, new Error('test')); - bitcoind.on('error', function(err) { + dashd._spawnChildProcess = sinon.stub().callsArgWith(0, new Error('test')); + dashd.on('error', function(err) { err.should.be.instanceOf(Error); err.message.should.equal('test'); done(); @@ -1929,10 +1929,10 @@ describe('Bitcoin Service', function() { process.emit('exit', 1); }); }); - it('will NOT respawn bitcoind spawned process if shutting down', function(done) { + it('will NOT respawn dashd spawned process if shutting down', function(done) { var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -1942,35 +1942,35 @@ describe('Bitcoin Service', function() { }); var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new TestBitcoinService(config); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind.spawn = {}; - bitcoind.spawn.exec = 'bitcoind'; - bitcoind.spawn.datadir = '/tmp/bitcoin'; - bitcoind.spawn.configPath = '/tmp/bitcoin/bitcoin.conf'; - bitcoind.spawn.config = {}; - bitcoind.spawnRestartTime = 1; - bitcoind._loadTipFromNode = sinon.stub().callsArg(1); - bitcoind._initZmqSubSocket = sinon.stub(); - bitcoind._checkReindex = sinon.stub().callsArg(1); - bitcoind._checkSyncedAndSubscribeZmqEvents = sinon.stub(); - bitcoind._stopSpawnedBitcoin = sinon.stub().callsArg(0); - sinon.spy(bitcoind, '_spawnChildProcess'); - bitcoind._spawnChildProcess(function(err) { + var dashd = new TestDashService(config); + dashd._loadSpawnConfiguration = sinon.stub(); + dashd.spawn = {}; + dashd.spawn.exec = 'dashd'; + dashd.spawn.datadir = '/tmp/dash'; + dashd.spawn.configPath = '/tmp/dash/dash.conf'; + dashd.spawn.config = {}; + dashd.spawnRestartTime = 1; + dashd._loadTipFromNode = sinon.stub().callsArg(1); + dashd._initZmqSubSocket = sinon.stub(); + dashd._checkReindex = sinon.stub().callsArg(1); + dashd._checkSyncedAndSubscribeZmqEvents = sinon.stub(); + dashd._stopSpawnedDash = sinon.stub().callsArg(0); + sinon.spy(dashd, '_spawnChildProcess'); + dashd._spawnChildProcess(function(err) { if (err) { return done(err); } - bitcoind.node.stopping = true; + dashd.node.stopping = true; process.once('exit', function() { setTimeout(function() { - bitcoind._spawnChildProcess.callCount.should.equal(1); + dashd._spawnChildProcess.callCount.should.equal(1); done(); }, 5); }); @@ -1980,7 +1980,7 @@ describe('Bitcoin Service', function() { it('will give error after 60 retries', function(done) { var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -1988,22 +1988,22 @@ describe('Bitcoin Service', function() { spawn: spawn } }); - var bitcoind = new TestBitcoinService(baseConfig); - bitcoind.startRetryInterval = 1; - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind.spawn = {}; - bitcoind.spawn.exec = 'testexec'; - bitcoind.spawn.configPath = 'testdir/bitcoin.conf'; - bitcoind.spawn.datadir = 'testdir'; - bitcoind.spawn.config = {}; - bitcoind.spawn.config.rpcport = 20001; - bitcoind.spawn.config.rpcuser = 'bitcoin'; - bitcoind.spawn.config.rpcpassword = 'password'; - bitcoind.spawn.config.zmqpubrawtx = 'tcp://127.0.0.1:30001'; - bitcoind.spawn.config.zmqpubrawtxlock = 'tcp://127.0.0.1:30001'; - bitcoind._loadTipFromNode = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind._spawnChildProcess(function(err) { - bitcoind._loadTipFromNode.callCount.should.equal(60); + var dashd = new TestDashService(baseConfig); + dashd.startRetryInterval = 1; + dashd._loadSpawnConfiguration = sinon.stub(); + dashd.spawn = {}; + dashd.spawn.exec = 'testexec'; + dashd.spawn.configPath = 'testdir/dash.conf'; + dashd.spawn.datadir = 'testdir'; + dashd.spawn.config = {}; + dashd.spawn.config.rpcport = 20001; + dashd.spawn.config.rpcuser = 'dash'; + dashd.spawn.config.rpcpassword = 'password'; + dashd.spawn.config.zmqpubrawtx = 'tcp://127.0.0.1:30001'; + dashd.spawn.config.zmqpubrawtxlock = 'tcp://127.0.0.1:30001'; + dashd._loadTipFromNode = sinon.stub().callsArgWith(1, new Error('test')); + dashd._spawnChildProcess(function(err) { + dashd._loadTipFromNode.callCount.should.equal(60); err.should.be.instanceof(Error); done(); }); @@ -2011,7 +2011,7 @@ describe('Bitcoin Service', function() { it('will give error from check reindex', function(done) { var process = new EventEmitter(); var spawn = sinon.stub().returns(process); - var TestBitcoinService = proxyquire('../../lib/services/bitcoind', { + var TestDashService = proxyquire('../../lib/services/dashd', { fs: { readFileSync: readFileSync }, @@ -2019,26 +2019,26 @@ describe('Bitcoin Service', function() { spawn: spawn } }); - var bitcoind = new TestBitcoinService(baseConfig); + var dashd = new TestDashService(baseConfig); - bitcoind._loadSpawnConfiguration = sinon.stub(); - bitcoind.spawn = {}; - bitcoind.spawn.exec = 'testexec'; - bitcoind.spawn.configPath = 'testdir/bitcoin.conf'; - bitcoind.spawn.datadir = 'testdir'; - bitcoind.spawn.config = {}; - bitcoind.spawn.config.rpcport = 20001; - bitcoind.spawn.config.rpcuser = 'bitcoin'; - bitcoind.spawn.config.rpcpassword = 'password'; - bitcoind.spawn.config.zmqpubrawtx = 'tcp://127.0.0.1:30001'; - bitcoind.spawn.config.zmqpubrawtxlock = 'tcp://127.0.0.1:30001'; + dashd._loadSpawnConfiguration = sinon.stub(); + dashd.spawn = {}; + dashd.spawn.exec = 'testexec'; + dashd.spawn.configPath = 'testdir/dash.conf'; + dashd.spawn.datadir = 'testdir'; + dashd.spawn.config = {}; + dashd.spawn.config.rpcport = 20001; + dashd.spawn.config.rpcuser = 'dash'; + dashd.spawn.config.rpcpassword = 'password'; + dashd.spawn.config.zmqpubrawtx = 'tcp://127.0.0.1:30001'; + dashd.spawn.config.zmqpubrawtxlock = 'tcp://127.0.0.1:30001'; - bitcoind._loadTipFromNode = sinon.stub().callsArgWith(1, null); - bitcoind._initZmqSubSocket = sinon.stub(); - bitcoind._checkSyncedAndSubscribeZmqEvents = sinon.stub(); - bitcoind._checkReindex = sinon.stub().callsArgWith(1, new Error('test')); + dashd._loadTipFromNode = sinon.stub().callsArgWith(1, null); + dashd._initZmqSubSocket = sinon.stub(); + dashd._checkSyncedAndSubscribeZmqEvents = sinon.stub(); + dashd._checkReindex = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind._spawnChildProcess(function(err) { + dashd._spawnChildProcess(function(err) { err.should.be.instanceof(Error); done(); }); @@ -2049,46 +2049,46 @@ describe('Bitcoin Service', function() { it('will give error if connecting while shutting down', function(done) { var config = { node: { - network: bitcore.Networks.testnet + network: dashcore.Networks.testnet }, spawn: { datadir: 'testdir', exec: 'testpath' } }; - var bitcoind = new BitcoinService(config); - bitcoind.node.stopping = true; - bitcoind.startRetryInterval = 100; - bitcoind._loadTipFromNode = sinon.stub(); - bitcoind._connectProcess({}, function(err) { + var dashd = new DashService(config); + dashd.node.stopping = true; + dashd.startRetryInterval = 100; + dashd._loadTipFromNode = sinon.stub(); + dashd._connectProcess({}, function(err) { err.should.be.instanceof(Error); err.message.should.match(/Stopping while trying to connect/); - bitcoind._loadTipFromNode.callCount.should.equal(0); + dashd._loadTipFromNode.callCount.should.equal(0); done(); }); }); it('will give error from loadTipFromNode after 60 retries', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._loadTipFromNode = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind.startRetryInterval = 1; + var dashd = new DashService(baseConfig); + dashd._loadTipFromNode = sinon.stub().callsArgWith(1, new Error('test')); + dashd.startRetryInterval = 1; var config = {}; - bitcoind._connectProcess(config, function(err) { + dashd._connectProcess(config, function(err) { err.should.be.instanceof(Error); - bitcoind._loadTipFromNode.callCount.should.equal(60); + dashd._loadTipFromNode.callCount.should.equal(60); done(); }); }); it('will init zmq/rpc on node', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._initZmqSubSocket = sinon.stub(); - bitcoind._subscribeZmqEvents = sinon.stub(); - bitcoind._loadTipFromNode = sinon.stub().callsArgWith(1, null); + var dashd = new DashService(baseConfig); + dashd._initZmqSubSocket = sinon.stub(); + dashd._subscribeZmqEvents = sinon.stub(); + dashd._loadTipFromNode = sinon.stub().callsArgWith(1, null); var config = {}; - bitcoind._connectProcess(config, function(err, node) { + dashd._connectProcess(config, function(err, node) { should.not.exist(err); - bitcoind._loadTipFromNode.callCount.should.equal(1); - bitcoind._initZmqSubSocket.callCount.should.equal(1); - bitcoind._loadTipFromNode.callCount.should.equal(1); + dashd._loadTipFromNode.callCount.should.equal(1); + dashd._initZmqSubSocket.callCount.should.equal(1); + dashd._loadTipFromNode.callCount.should.equal(1); should.exist(node); should.exist(node.client); done(); @@ -2105,69 +2105,69 @@ describe('Bitcoin Service', function() { sandbox.restore(); }); it('will give error if "spawn" and "connect" are both not configured', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.options = {}; - bitcoind.start(function(err) { + var dashd = new DashService(baseConfig); + dashd.options = {}; + dashd.start(function(err) { err.should.be.instanceof(Error); - err.message.should.match(/Bitcoin configuration options/); + err.message.should.match(/Dash configuration options/); }); done(); }); it('will give error from spawnChildProcess', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._spawnChildProcess = sinon.stub().callsArgWith(0, new Error('test')); - bitcoind.options = { + var dashd = new DashService(baseConfig); + dashd._spawnChildProcess = sinon.stub().callsArgWith(0, new Error('test')); + dashd.options = { spawn: {} }; - bitcoind.start(function(err) { + dashd.start(function(err) { err.should.be.instanceof(Error); err.message.should.equal('test'); done(); }); }); it('will give error from connectProcess', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._connectProcess = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind.options = { + var dashd = new DashService(baseConfig); + dashd._connectProcess = sinon.stub().callsArgWith(1, new Error('test')); + dashd.options = { connect: [ {} ] }; - bitcoind.start(function(err) { - bitcoind._connectProcess.callCount.should.equal(1); + dashd.start(function(err) { + dashd._connectProcess.callCount.should.equal(1); err.should.be.instanceof(Error); err.message.should.equal('test'); done(); }); }); it('will push node from spawnChildProcess', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var node = {}; - bitcoind._initChain = sinon.stub().callsArg(0); - bitcoind._spawnChildProcess = sinon.stub().callsArgWith(0, null, node); - bitcoind.options = { + dashd._initChain = sinon.stub().callsArg(0); + dashd._spawnChildProcess = sinon.stub().callsArgWith(0, null, node); + dashd.options = { spawn: {} }; - bitcoind.start(function(err) { + dashd.start(function(err) { should.not.exist(err); - bitcoind.nodes.length.should.equal(1); + dashd.nodes.length.should.equal(1); done(); }); }); it('will push node from connectProcess', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._initChain = sinon.stub().callsArg(0); + var dashd = new DashService(baseConfig); + dashd._initChain = sinon.stub().callsArg(0); var nodes = [{}]; - bitcoind._connectProcess = sinon.stub().callsArgWith(1, null, nodes); - bitcoind.options = { + dashd._connectProcess = sinon.stub().callsArgWith(1, null, nodes); + dashd.options = { connect: [ {} ] }; - bitcoind.start(function(err) { + dashd.start(function(err) { should.not.exist(err); - bitcoind._connectProcess.callCount.should.equal(1); - bitcoind.nodes.length.should.equal(1); + dashd._connectProcess.callCount.should.equal(1); + dashd.nodes.length.should.equal(1); done(); }); }); @@ -2175,18 +2175,18 @@ describe('Bitcoin Service', function() { describe('#isSynced', function() { it('will give error from syncPercentage', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, new Error('test')); - bitcoind.isSynced(function(err) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, new Error('test')); + dashd.isSynced(function(err) { should.exist(err); err.message.should.equal('test'); done(); }); }); it('will give "true" if percentage is 100.00', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, null, 100.00); - bitcoind.isSynced(function(err, synced) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, null, 100.00); + dashd.isSynced(function(err, synced) { if (err) { return done(err); } @@ -2195,9 +2195,9 @@ describe('Bitcoin Service', function() { }); }); it('will give "true" if percentage is 99.98', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, null, 99.98); - bitcoind.isSynced(function(err, synced) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, null, 99.98); + dashd.isSynced(function(err, synced) { if (err) { return done(err); } @@ -2206,9 +2206,9 @@ describe('Bitcoin Service', function() { }); }); it('will give "false" if percentage is 99.49', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, null, 99.49); - bitcoind.isSynced(function(err, synced) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, null, 99.49); + dashd.isSynced(function(err, synced) { if (err) { return done(err); } @@ -2217,9 +2217,9 @@ describe('Bitcoin Service', function() { }); }); it('will give "false" if percentage is 1', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.syncPercentage = sinon.stub().callsArgWith(0, null, 1); - bitcoind.isSynced(function(err, synced) { + var dashd = new DashService(baseConfig); + dashd.syncPercentage = sinon.stub().callsArgWith(0, null, 1); + dashd.isSynced(function(err, synced) { if (err) { return done(err); } @@ -2231,32 +2231,32 @@ describe('Bitcoin Service', function() { describe('#syncPercentage', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockchainInfo = sinon.stub().callsArgWith(0, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockchainInfo: getBlockchainInfo } }); - bitcoind.syncPercentage(function(err) { + dashd.syncPercentage(function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will call client getInfo and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockchainInfo = sinon.stub().callsArgWith(0, null, { result: { verificationprogress: '0.983821387' } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockchainInfo: getBlockchainInfo } }); - bitcoind.syncPercentage(function(err, percentage) { + dashd.syncPercentage(function(err, percentage) { if (err) { return done(err); } @@ -2268,54 +2268,54 @@ describe('Bitcoin Service', function() { describe('#_normalizeAddressArg', function() { it('will turn single address into array', function() { - var bitcoind = new BitcoinService(baseConfig); - var args = bitcoind._normalizeAddressArg('address'); + var dashd = new DashService(baseConfig); + var args = dashd._normalizeAddressArg('address'); args.should.deep.equal(['address']); }); it('will keep an array as an array', function() { - var bitcoind = new BitcoinService(baseConfig); - var args = bitcoind._normalizeAddressArg(['address', 'address']); + var dashd = new DashService(baseConfig); + var args = dashd._normalizeAddressArg(['address', 'address']); args.should.deep.equal(['address', 'address']); }); }); describe('#getAddressBalance', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressBalance: sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}) } }); var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; var options = {}; - bitcoind.getAddressBalance(address, options, function(err) { + dashd.getAddressBalance(address, options, function(err) { err.should.be.instanceof(Error); done(); }); }); it('will give balance', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressBalance = sinon.stub().callsArgWith(1, null, { result: { received: 100000, balance: 10000 } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressBalance: getAddressBalance } }); var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; var options = {}; - bitcoind.getAddressBalance(address, options, function(err, data) { + dashd.getAddressBalance(address, options, function(err, data) { if (err) { return done(err); } data.balance.should.equal(10000); data.received.should.equal(100000); - bitcoind.getAddressBalance(address, options, function(err, data2) { + dashd.getAddressBalance(address, options, function(err, data2) { if (err) { return done(err); } @@ -2330,8 +2330,8 @@ describe('Bitcoin Service', function() { describe('#getAddressUnspentOutputs', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}) } @@ -2340,14 +2340,14 @@ describe('Bitcoin Service', function() { queryMempool: false }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err) { + dashd.getAddressUnspentOutputs(address, options, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); done(); }); }); it('will give results from client getaddressutxos', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2358,7 +2358,7 @@ describe('Bitcoin Service', function() { height: 207111 } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: expectedUtxos @@ -2369,7 +2369,7 @@ describe('Bitcoin Service', function() { queryMempool: false }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2379,7 +2379,7 @@ describe('Bitcoin Service', function() { }); }); it('will use cache', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var expectedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2393,7 +2393,7 @@ describe('Bitcoin Service', function() { var getAddressUtxos = sinon.stub().callsArgWith(1, null, { result: expectedUtxos }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: getAddressUtxos } @@ -2402,14 +2402,14 @@ describe('Bitcoin Service', function() { queryMempool: false }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } utxos.length.should.equal(1); utxos.should.deep.equal(expectedUtxos); getAddressUtxos.callCount.should.equal(1); - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2446,7 +2446,7 @@ describe('Bitcoin Service', function() { timestamp: 1461342954813 } ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var confirmedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2475,7 +2475,7 @@ describe('Bitcoin Service', function() { txid: 'f637384e9f81f18767ea50e00bce58fc9848b6588a1130529eebba22a410155f' } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: confirmedUtxos @@ -2489,7 +2489,7 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2519,7 +2519,7 @@ describe('Bitcoin Service', function() { prevout: 2 } ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var confirmedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2538,7 +2538,7 @@ describe('Bitcoin Service', function() { height: 207111 } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: confirmedUtxos @@ -2552,7 +2552,7 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2598,7 +2598,7 @@ describe('Bitcoin Service', function() { timestamp: 1461342833133 } ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var confirmedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2625,7 +2625,7 @@ describe('Bitcoin Service', function() { height: 207111 } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: confirmedUtxos @@ -2639,7 +2639,7 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2705,9 +2705,9 @@ describe('Bitcoin Service', function() { timestamp: 1461342833133 } ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var confirmedUtxos = []; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: confirmedUtxos @@ -2721,7 +2721,7 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2746,7 +2746,7 @@ describe('Bitcoin Service', function() { prevout: 1 } ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var confirmedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2757,7 +2757,7 @@ describe('Bitcoin Service', function() { height: 207111 } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: confirmedUtxos @@ -2771,7 +2771,7 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2789,7 +2789,7 @@ describe('Bitcoin Service', function() { timestamp: 1461342707725 } ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var confirmedUtxos = [ { address: 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs', @@ -2800,7 +2800,7 @@ describe('Bitcoin Service', function() { height: 207111 } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressUtxos: sinon.stub().callsArgWith(1, null, { result: confirmedUtxos @@ -2814,7 +2814,7 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err, utxos) { + dashd.getAddressUnspentOutputs(address, options, function(err, utxos) { if (err) { return done(err); } @@ -2823,8 +2823,8 @@ describe('Bitcoin Service', function() { }); }); it('it will handle error from getAddressMempool', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, {code: -1, message: 'test'}) } @@ -2833,22 +2833,22 @@ describe('Bitcoin Service', function() { queryMempool: true }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err) { + dashd.getAddressUnspentOutputs(address, options, function(err) { err.should.be.instanceOf(Error); done(); }); }); it('should set query mempool if undefined', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressMempool = sinon.stub().callsArgWith(1, {code: -1, message: 'test'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressMempool: getAddressMempool } }); var options = {}; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressUnspentOutputs(address, options, function(err) { + dashd.getAddressUnspentOutputs(address, options, function(err) { getAddressMempool.callCount.should.equal(1); done(); }); @@ -2857,7 +2857,7 @@ describe('Bitcoin Service', function() { describe('#_getBalanceFromMempool', function() { it('will sum satoshis', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var deltas = [ { satoshis: -1000, @@ -2869,14 +2869,14 @@ describe('Bitcoin Service', function() { satoshis: -10, } ]; - var sum = bitcoind._getBalanceFromMempool(deltas); + var sum = dashd._getBalanceFromMempool(deltas); sum.should.equal(990); }); }); describe('#_getTxidsFromMempool', function() { it('will filter to txids', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var deltas = [ { txid: 'txid0', @@ -2888,14 +2888,14 @@ describe('Bitcoin Service', function() { txid: 'txid2', } ]; - var txids = bitcoind._getTxidsFromMempool(deltas); + var txids = dashd._getTxidsFromMempool(deltas); txids.length.should.equal(3); txids[0].should.equal('txid0'); txids[1].should.equal('txid1'); txids[2].should.equal('txid2'); }); it('will not include duplicates', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var deltas = [ { txid: 'txid0', @@ -2907,7 +2907,7 @@ describe('Bitcoin Service', function() { txid: 'txid1', } ]; - var txids = bitcoind._getTxidsFromMempool(deltas); + var txids = dashd._getTxidsFromMempool(deltas); txids.length.should.equal(2); txids[0].should.equal('txid0'); txids[1].should.equal('txid1'); @@ -2916,64 +2916,64 @@ describe('Bitcoin Service', function() { describe('#_getHeightRangeQuery', function() { it('will detect range query', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var options = { start: 20, end: 0 }; - var rangeQuery = bitcoind._getHeightRangeQuery(options); + var rangeQuery = dashd._getHeightRangeQuery(options); rangeQuery.should.equal(true); }); it('will get range properties', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var options = { start: 20, end: 0 }; var clone = {}; - bitcoind._getHeightRangeQuery(options, clone); + dashd._getHeightRangeQuery(options, clone); clone.end.should.equal(20); clone.start.should.equal(0); }); it('will throw error with invalid range', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var options = { start: 0, end: 20 }; (function() { - bitcoind._getHeightRangeQuery(options); + dashd._getHeightRangeQuery(options); }).should.throw('"end" is expected'); }); }); describe('#getAddressTxids', function() { it('will give error from _getHeightRangeQuery', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._getHeightRangeQuery = sinon.stub().throws(new Error('test')); - bitcoind.getAddressTxids('address', {}, function(err) { + var dashd = new DashService(baseConfig); + dashd._getHeightRangeQuery = sinon.stub().throws(new Error('test')); + dashd.getAddressTxids('address', {}, function(err) { err.should.be.instanceOf(Error); err.message.should.equal('test'); done(); }); }); it('will give rpc error from mempool query', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}) } }); var options = {}; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressTxids(address, options, function(err) { + dashd.getAddressTxids(address, options, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); }); }); it('will give rpc error from txids query', function() { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressTxids: sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}) } @@ -2982,7 +2982,7 @@ describe('Bitcoin Service', function() { queryMempool: false }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressTxids(address, options, function(err) { + dashd.getAddressTxids(address, options, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); }); @@ -3000,8 +3000,8 @@ describe('Bitcoin Service', function() { 'ed11a08e3102f9610bda44c80c46781d97936a4290691d87244b1b345b39a693', 'ec94d845c603f292a93b7c829811ac624b76e52b351617ca5a758e9d61a11681' ]; - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressTxids: sinon.stub().callsArgWith(1, null, { result: expectedTxids.reverse() @@ -3012,7 +3012,7 @@ describe('Bitcoin Service', function() { queryMempool: false }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressTxids(address, options, function(err, txids) { + dashd.getAddressTxids(address, options, function(err, txids) { if (err) { return done(err); } @@ -3025,11 +3025,11 @@ describe('Bitcoin Service', function() { var expectedTxids = [ 'e9dcf22807db77ac0276b03cc2d3a8b03c4837db8ac6650501ef45af1c807cce' ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressTxids = sinon.stub().callsArgWith(1, null, { result: expectedTxids.reverse() }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressTxids: getAddressTxids } @@ -3038,14 +3038,14 @@ describe('Bitcoin Service', function() { queryMempool: false }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressTxids(address, options, function(err, txids) { + dashd.getAddressTxids(address, options, function(err, txids) { if (err) { return done(err); } getAddressTxids.callCount.should.equal(1); txids.should.deep.equal(expectedTxids); - bitcoind.getAddressTxids(address, options, function(err, txids) { + dashd.getAddressTxids(address, options, function(err, txids) { if (err) { return done(err); } @@ -3059,12 +3059,12 @@ describe('Bitcoin Service', function() { var expectedTxids = [ 'e9dcf22807db77ac0276b03cc2d3a8b03c4837db8ac6650501ef45af1c807cce' ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressMempool = sinon.stub(); var getAddressTxids = sinon.stub().callsArgWith(1, null, { result: expectedTxids.reverse() }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressTxids: getAddressTxids, getAddressMempool: getAddressMempool @@ -3076,7 +3076,7 @@ describe('Bitcoin Service', function() { end: 2 }; var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressTxids(address, options, function(err, txids) { + dashd.getAddressTxids(address, options, function(err, txids) { if (err) { return done(err); } @@ -3084,7 +3084,7 @@ describe('Bitcoin Service', function() { getAddressMempool.callCount.should.equal(0); txids.should.deep.equal(expectedTxids); - bitcoind.getAddressTxids(address, options, function(err, txids) { + dashd.getAddressTxids(address, options, function(err, txids) { if (err) { return done(err); } @@ -3099,7 +3099,7 @@ describe('Bitcoin Service', function() { var expectedTxids = [ 'e9dcf22807db77ac0276b03cc2d3a8b03c4837db8ac6650501ef45af1c807cce' ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressTxids = sinon.stub().callsArgWith(1, null, { result: expectedTxids.reverse() }); @@ -3116,21 +3116,21 @@ describe('Bitcoin Service', function() { } ] }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressTxids: getAddressTxids, getAddressMempool: getAddressMempool } }); var address = 'XnQuJpAgEDNtRwoXWLfuEs69cMgCYS8rgs'; - bitcoind.getAddressTxids(address, {queryMempool: false}, function(err, txids) { + dashd.getAddressTxids(address, {queryMempool: false}, function(err, txids) { if (err) { return done(err); } getAddressTxids.callCount.should.equal(1); txids.should.deep.equal(expectedTxids); - bitcoind.getAddressTxids(address, {queryMempool: true}, function(err, txids) { + dashd.getAddressTxids(address, {queryMempool: true}, function(err, txids) { if (err) { return done(err); } @@ -3158,69 +3158,69 @@ describe('Bitcoin Service', function() { it('should get 0 confirmation', function() { var tx = new Transaction(txhex); tx.height = -1; - var bitcoind = new BitcoinService(baseConfig); - bitcoind.height = 10; - var confirmations = bitcoind._getConfirmationsDetail(tx); + var dashd = new DashService(baseConfig); + dashd.height = 10; + var confirmations = dashd._getConfirmationsDetail(tx); confirmations.should.equal(0); }); it('should get 1 confirmation', function() { var tx = new Transaction(txhex); tx.height = 10; - var bitcoind = new BitcoinService(baseConfig); - bitcoind.height = 10; - var confirmations = bitcoind._getConfirmationsDetail(tx); + var dashd = new DashService(baseConfig); + dashd.height = 10; + var confirmations = dashd._getConfirmationsDetail(tx); confirmations.should.equal(1); }); it('should get 2 confirmation', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var tx = new Transaction(txhex); - bitcoind.height = 11; + dashd.height = 11; tx.height = 10; - var confirmations = bitcoind._getConfirmationsDetail(tx); + var confirmations = dashd._getConfirmationsDetail(tx); confirmations.should.equal(2); }); it('should get 0 confirmation with overflow', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var tx = new Transaction(txhex); - bitcoind.height = 3; + dashd.height = 3; tx.height = 10; - var confirmations = bitcoind._getConfirmationsDetail(tx); + var confirmations = dashd._getConfirmationsDetail(tx); log.warn.callCount.should.equal(1); confirmations.should.equal(0); }); it('should get 1000 confirmation', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var tx = new Transaction(txhex); - bitcoind.height = 1000; + dashd.height = 1000; tx.height = 1; - var confirmations = bitcoind._getConfirmationsDetail(tx); + var confirmations = dashd._getConfirmationsDetail(tx); confirmations.should.equal(1000); }); }); describe('#_getAddressDetailsForInput', function() { it('will return if missing an address', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = {}; - bitcoind._getAddressDetailsForInput({}, 0, result, []); + dashd._getAddressDetailsForInput({}, 0, result, []); should.not.exist(result.addresses); should.not.exist(result.satoshis); }); it('will only add address if it matches', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = {}; - bitcoind._getAddressDetailsForInput({ + dashd._getAddressDetailsForInput({ address: 'address1' }, 0, result, ['address2']); should.not.exist(result.addresses); should.not.exist(result.satoshis); }); it('will instantiate if outputIndexes not defined', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { addresses: {} }; - bitcoind._getAddressDetailsForInput({ + dashd._getAddressDetailsForInput({ address: 'address1' }, 0, result, ['address1']); should.exist(result.addresses); @@ -3228,7 +3228,7 @@ describe('Bitcoin Service', function() { result.addresses['address1'].outputIndexes.should.deep.equal([]); }); it('will push to inputIndexes', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { addresses: { 'address1': { @@ -3236,7 +3236,7 @@ describe('Bitcoin Service', function() { } } }; - bitcoind._getAddressDetailsForInput({ + dashd._getAddressDetailsForInput({ address: 'address1' }, 2, result, ['address1']); should.exist(result.addresses); @@ -3246,27 +3246,27 @@ describe('Bitcoin Service', function() { describe('#_getAddressDetailsForOutput', function() { it('will return if missing an address', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = {}; - bitcoind._getAddressDetailsForOutput({}, 0, result, []); + dashd._getAddressDetailsForOutput({}, 0, result, []); should.not.exist(result.addresses); should.not.exist(result.satoshis); }); it('will only add address if it matches', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = {}; - bitcoind._getAddressDetailsForOutput({ + dashd._getAddressDetailsForOutput({ address: 'address1' }, 0, result, ['address2']); should.not.exist(result.addresses); should.not.exist(result.satoshis); }); it('will instantiate if outputIndexes not defined', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { addresses: {} }; - bitcoind._getAddressDetailsForOutput({ + dashd._getAddressDetailsForOutput({ address: 'address1' }, 0, result, ['address1']); should.exist(result.addresses); @@ -3274,7 +3274,7 @@ describe('Bitcoin Service', function() { result.addresses['address1'].outputIndexes.should.deep.equal([0]); }); it('will push if outputIndexes defined', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { addresses: { 'address1': { @@ -3282,7 +3282,7 @@ describe('Bitcoin Service', function() { } } }; - bitcoind._getAddressDetailsForOutput({ + dashd._getAddressDetailsForOutput({ address: 'address1' }, 1, result, ['address1']); should.exist(result.addresses); @@ -3324,9 +3324,9 @@ describe('Bitcoin Service', function() { ], locktime: 0 }; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var addresses = ['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW']; - var details = bitcoind._getAddressDetailsForTransaction(tx, addresses); + var details = dashd._getAddressDetailsForTransaction(tx, addresses); should.exist(details.addresses['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW']); details.addresses['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'].inputIndexes.should.deep.equal([0]); details.addresses['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'].outputIndexes.should.deep.equal([ @@ -3343,15 +3343,15 @@ describe('Bitcoin Service', function() { var tx = { height: 20, }; - var bitcoind = new BitcoinService(baseConfig); - bitcoind.getDetailedTransaction = sinon.stub().callsArgWith(1, null, tx); - bitcoind.height = 300; + var dashd = new DashService(baseConfig); + dashd.getDetailedTransaction = sinon.stub().callsArgWith(1, null, tx); + dashd.height = 300; var addresses = {}; - bitcoind._getAddressDetailsForTransaction = sinon.stub().returns({ + dashd._getAddressDetailsForTransaction = sinon.stub().returns({ addresses: addresses, satoshis: 1000, }); - bitcoind._getAddressDetailedTransaction(txid, {}, function(err, details) { + dashd._getAddressDetailedTransaction(txid, {}, function(err, details) { if (err) { return done(err); } @@ -3364,9 +3364,9 @@ describe('Bitcoin Service', function() { }); it('give error from getDetailedTransaction', function(done) { var txid = '46f24e0c274fc07708b781963576c4c5d5625d926dbb0a17fa865dcd9fe58ea0'; - var bitcoind = new BitcoinService(baseConfig); - bitcoind.getDetailedTransaction = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind._getAddressDetailedTransaction(txid, {}, function(err) { + var dashd = new DashService(baseConfig); + dashd.getDetailedTransaction = sinon.stub().callsArgWith(1, new Error('test')); + dashd._getAddressDetailedTransaction(txid, {}, function(err) { err.should.be.instanceof(Error); done(); }); @@ -3374,13 +3374,13 @@ describe('Bitcoin Service', function() { }); describe('#_getAddressStrings', function() { - it('will get address strings from bitcore addresses', function() { + it('will get address strings from dashcore addresses', function() { var addresses = [ - bitcore.Address('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'), - bitcore.Address('7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'), + dashcore.Address('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'), + dashcore.Address('7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'), ]; - var bitcoind = new BitcoinService(baseConfig); - var strings = bitcoind._getAddressStrings(addresses); + var dashd = new DashService(baseConfig); + var strings = dashd._getAddressStrings(addresses); strings[0].should.equal('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'); strings[1].should.equal('7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'); }); @@ -3389,63 +3389,63 @@ describe('Bitcoin Service', function() { 'XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN', '7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz', ]; - var bitcoind = new BitcoinService(baseConfig); - var strings = bitcoind._getAddressStrings(addresses); + var dashd = new DashService(baseConfig); + var strings = dashd._getAddressStrings(addresses); strings[0].should.equal('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'); strings[1].should.equal('7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'); }); it('will get address strings from mixture of types', function() { var addresses = [ - bitcore.Address('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'), + dashcore.Address('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'), '7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz', ]; - var bitcoind = new BitcoinService(baseConfig); - var strings = bitcoind._getAddressStrings(addresses); + var dashd = new DashService(baseConfig); + var strings = dashd._getAddressStrings(addresses); strings[0].should.equal('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'); strings[1].should.equal('7d5169eBcGHF4BYC6DTffTyeCpWbrZnNgz'); }); it('will give error with unknown', function() { var addresses = [ - bitcore.Address('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'), + dashcore.Address('XjxDQFjTNEP9dcrJhBLvy5i1Dobz4x1LJN'), 0, ]; - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); (function() { - bitcoind._getAddressStrings(addresses); + dashd._getAddressStrings(addresses); }).should.throw(TypeError); }); }); describe('#_paginateTxids', function() { it('slice txids based on "from" and "to" (3 to 13)', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var txids = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - var paginated = bitcoind._paginateTxids(txids, 3, 13); + var paginated = dashd._paginateTxids(txids, 3, 13); paginated.should.deep.equal([3, 4, 5, 6, 7, 8, 9, 10]); }); it('slice txids based on "from" and "to" (0 to 3)', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var txids = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - var paginated = bitcoind._paginateTxids(txids, 0, 3); + var paginated = dashd._paginateTxids(txids, 0, 3); paginated.should.deep.equal([0, 1, 2]); }); it('slice txids based on "from" and "to" (0 to 1)', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var txids = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - var paginated = bitcoind._paginateTxids(txids, 0, 1); + var paginated = dashd._paginateTxids(txids, 0, 1); paginated.should.deep.equal([0]); }); it('will throw error if "from" is greater than "to"', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var txids = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; (function() { - bitcoind._paginateTxids(txids, 1, 0); + dashd._paginateTxids(txids, 1, 0); }).should.throw('"from" (1) is expected to be less than "to"'); }); it('will handle string numbers', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var txids = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - var paginated = bitcoind._paginateTxids(txids, '1', '3'); + var paginated = dashd._paginateTxids(txids, '1', '3'); paginated.should.deep.equal([1, 2]); }); }); @@ -3453,27 +3453,27 @@ describe('Bitcoin Service', function() { describe('#getAddressHistory', function() { var address = 'XcHw3hNN293dY1AYrbeBrP1sB6vsugTQTz'; it('will give error with "from" and "to" range that exceeds max size', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.getAddressHistory(address, {from: 0, to: 51}, function(err) { + var dashd = new DashService(baseConfig); + dashd.getAddressHistory(address, {from: 0, to: 51}, function(err) { should.exist(err); err.message.match(/^\"from/); done(); }); }); it('will give error with "from" and "to" order is reversed', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, []); - bitcoind.getAddressHistory(address, {from: 51, to: 0}, function(err) { + var dashd = new DashService(baseConfig); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, []); + dashd.getAddressHistory(address, {from: 51, to: 0}, function(err) { should.exist(err); err.message.match(/^\"from/); done(); }); }); it('will give error from _getAddressDetailedTransaction', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, ['txid']); - bitcoind._getAddressDetailedTransaction = sinon.stub().callsArgWith(2, new Error('test')); - bitcoind.getAddressHistory(address, {}, function(err) { + var dashd = new DashService(baseConfig); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, ['txid']); + dashd._getAddressDetailedTransaction = sinon.stub().callsArgWith(2, new Error('test')); + dashd.getAddressHistory(address, {}, function(err) { should.exist(err); err.message.should.equal('test'); done(); @@ -3484,18 +3484,18 @@ describe('Bitcoin Service', function() { for (var i = 0; i < 101; i++) { addresses.push(address); } - var bitcoind = new BitcoinService(baseConfig); - bitcoind.maxAddressesQuery = 100; - bitcoind.getAddressHistory(addresses, {}, function(err) { + var dashd = new DashService(baseConfig); + dashd.maxAddressesQuery = 100; + dashd.getAddressHistory(addresses, {}, function(err) { should.exist(err); err.message.match(/Maximum/); done(); }); }); it('give error from getAddressTxids', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, new Error('test')); - bitcoind.getAddressHistory('address', {}, function(err) { + var dashd = new DashService(baseConfig); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, new Error('test')); + dashd.getAddressHistory('address', {}, function(err) { should.exist(err); err.should.be.instanceof(Error); err.message.should.equal('test'); @@ -3503,13 +3503,13 @@ describe('Bitcoin Service', function() { }); }); it('will paginate', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._getAddressDetailedTransaction = function(txid, options, callback) { + var dashd = new DashService(baseConfig); + dashd._getAddressDetailedTransaction = function(txid, options, callback) { callback(null, txid); }; var txids = ['one', 'two', 'three', 'four']; - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, txids); - bitcoind.getAddressHistory('address', {from: 1, to: 3}, function(err, data) { + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, txids); + dashd.getAddressHistory('address', {from: 1, to: 3}, function(err, data) { if (err) { return done(err); } @@ -3527,8 +3527,8 @@ describe('Bitcoin Service', function() { var memtxid1 = 'b1bfa8dbbde790cb46b9763ef3407c1a21c8264b67bfe224f462ec0e1f569e92'; var memtxid2 = 'e9dcf22807db77ac0276b03cc2d3a8b03c4837db8ac6650501ef45af1c807cce'; it('will handle error from getAddressTxids', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, null, { result: [ @@ -3539,11 +3539,11 @@ describe('Bitcoin Service', function() { }) } }); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, new Error('test')); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, {}); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, new Error('test')); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, {}); var address = ''; var options = {}; - bitcoind.getAddressSummary(address, options, function(err) { + dashd.getAddressSummary(address, options, function(err) { should.exist(err); err.should.be.instanceof(Error); err.message.should.equal('test'); @@ -3551,8 +3551,8 @@ describe('Bitcoin Service', function() { }); }); it('will handle error from getAddressBalance', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, null, { result: [ @@ -3563,11 +3563,11 @@ describe('Bitcoin Service', function() { }) } }); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, {}); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, new Error('test'), {}); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, {}); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, new Error('test'), {}); var address = ''; var options = {}; - bitcoind.getAddressSummary(address, options, function(err) { + dashd.getAddressSummary(address, options, function(err) { should.exist(err); err.should.be.instanceof(Error); err.message.should.equal('test'); @@ -3575,17 +3575,17 @@ describe('Bitcoin Service', function() { }); }); it('will handle error from client getAddressMempool', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}) } }); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, {}); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, {}); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, {}); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, {}); var address = ''; var options = {}; - bitcoind.getAddressSummary(address, options, function(err) { + dashd.getAddressSummary(address, options, function(err) { should.exist(err); err.should.be.instanceof(Error); err.message.should.equal('Test error'); @@ -3593,8 +3593,8 @@ describe('Bitcoin Service', function() { }); }); it('should set all properties', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, null, { result: [ @@ -3610,18 +3610,18 @@ describe('Bitcoin Service', function() { }) } }); - sinon.spy(bitcoind, '_paginateTxids'); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, { + sinon.spy(dashd, '_paginateTxids'); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, { received: 30 * 1e8, balance: 20 * 1e8 }); var address = '7oK6xjGeVK5YCT5dpqzNXGUag1bQadPAyT'; var options = {}; - bitcoind.getAddressSummary(address, options, function(err, summary) { - bitcoind._paginateTxids.callCount.should.equal(1); - bitcoind._paginateTxids.args[0][1].should.equal(0); - bitcoind._paginateTxids.args[0][2].should.equal(1000); + dashd.getAddressSummary(address, options, function(err, summary) { + dashd._paginateTxids.callCount.should.equal(1); + dashd._paginateTxids.args[0][1].should.equal(0); + dashd._paginateTxids.args[0][2].should.equal(1000); summary.appearances.should.equal(3); summary.totalReceived.should.equal(3000000000); summary.totalSpent.should.equal(1000000000); @@ -3639,8 +3639,8 @@ describe('Bitcoin Service', function() { }); }); it('will give error with "from" and "to" range that exceeds max size', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, null, { result: [ @@ -3656,8 +3656,8 @@ describe('Bitcoin Service', function() { }) } }); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, { + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, { received: 30 * 1e8, balance: 20 * 1e8 }); @@ -3666,15 +3666,15 @@ describe('Bitcoin Service', function() { from: 0, to: 1001 }; - bitcoind.getAddressSummary(address, options, function(err) { + dashd.getAddressSummary(address, options, function(err) { should.exist(err); err.message.match(/^\"from/); done(); }); }); it('will get from cache with noTxList', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getAddressMempool: sinon.stub().callsArgWith(1, null, { result: [ @@ -3690,8 +3690,8 @@ describe('Bitcoin Service', function() { }) } }); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, { + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, { received: 30 * 1e8, balance: 20 * 1e8 }); @@ -3708,29 +3708,29 @@ describe('Bitcoin Service', function() { summary.unconfirmedBalance.should.equal(-900001); should.not.exist(summary.txids); } - bitcoind.getAddressSummary(address, options, function(err, summary) { + dashd.getAddressSummary(address, options, function(err, summary) { checkSummary(summary); - bitcoind.getAddressTxids.callCount.should.equal(1); - bitcoind.getAddressBalance.callCount.should.equal(1); - bitcoind.getAddressSummary(address, options, function(err, summary) { + dashd.getAddressTxids.callCount.should.equal(1); + dashd.getAddressBalance.callCount.should.equal(1); + dashd.getAddressSummary(address, options, function(err, summary) { checkSummary(summary); - bitcoind.getAddressTxids.callCount.should.equal(1); - bitcoind.getAddressBalance.callCount.should.equal(1); + dashd.getAddressTxids.callCount.should.equal(1); + dashd.getAddressBalance.callCount.should.equal(1); done(); }); }); }); it('will skip querying the mempool with queryMempool set to false', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressMempool = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressMempool: getAddressMempool } }); - sinon.spy(bitcoind, '_paginateTxids'); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, { + sinon.spy(dashd, '_paginateTxids'); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, { received: 30 * 1e8, balance: 20 * 1e8 }); @@ -3738,31 +3738,31 @@ describe('Bitcoin Service', function() { var options = { queryMempool: false }; - bitcoind.getAddressSummary(address, options, function() { + dashd.getAddressSummary(address, options, function() { getAddressMempool.callCount.should.equal(0); done(); }); }); it('will give error from _paginateTxids', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getAddressMempool = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getAddressMempool: getAddressMempool } }); - sinon.spy(bitcoind, '_paginateTxids'); - bitcoind.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); - bitcoind.getAddressBalance = sinon.stub().callsArgWith(2, null, { + sinon.spy(dashd, '_paginateTxids'); + dashd.getAddressTxids = sinon.stub().callsArgWith(2, null, [txid1, txid2, txid3]); + dashd.getAddressBalance = sinon.stub().callsArgWith(2, null, { received: 30 * 1e8, balance: 20 * 1e8 }); - bitcoind._paginateTxids = sinon.stub().throws(new Error('test')); + dashd._paginateTxids = sinon.stub().throws(new Error('test')); var address = '7oK6xjGeVK5YCT5dpqzNXGUag1bQadPAyT'; var options = { queryMempool: false }; - bitcoind.getAddressSummary(address, options, function(err) { + dashd.getAddressSummary(address, options, function(err) { err.should.be.instanceOf(Error); err.message.should.equal('test'); done(); @@ -3774,46 +3774,46 @@ describe('Bitcoin Service', function() { var blockhash = '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'; var blockhex = '0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000'; it('will give rcp error from client getblockhash', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getBlockHash: sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}) } }); - bitcoind.getRawBlock(10, function(err) { + dashd.getRawBlock(10, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); done(); }); }); it('will give rcp error from client getblock', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getBlock: sinon.stub().callsArgWith(2, {code: -1, message: 'Test error'}) } }); - bitcoind.getRawBlock(blockhash, function(err) { + dashd.getRawBlock(blockhash, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); done(); }); }); it('will try all nodes for getblock', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockWithError = sinon.stub().callsArgWith(2, {code: -1, message: 'Test error'}); - bitcoind.tryAllInterval = 1; - bitcoind.nodes.push({ + dashd.tryAllInterval = 1; + dashd.nodes.push({ client: { getBlock: getBlockWithError } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlockWithError } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: sinon.stub().callsArgWith(2, null, { result: blockhex @@ -3821,8 +3821,8 @@ describe('Bitcoin Service', function() { } }); //cause first call will be not getBlock, but _maybeGetBlockHash, which will set up nodesIndex to 0 - bitcoind.nodesIndex = 2; - bitcoind.getRawBlock(blockhash, function(err, buffer) { + dashd.nodesIndex = 2; + dashd.getRawBlock(blockhash, function(err, buffer) { if (err) { return done(err); } @@ -3832,22 +3832,22 @@ describe('Bitcoin Service', function() { }); }); it('will get block from cache', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, null, { result: blockhex }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock } }); - bitcoind.getRawBlock(blockhash, function(err, buffer) { + dashd.getRawBlock(blockhash, function(err, buffer) { if (err) { return done(err); } buffer.should.be.instanceof(Buffer); getBlock.callCount.should.equal(1); - bitcoind.getRawBlock(blockhash, function(err, buffer) { + dashd.getRawBlock(blockhash, function(err, buffer) { if (err) { return done(err); } @@ -3858,20 +3858,20 @@ describe('Bitcoin Service', function() { }); }); it('will get block by height', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, null, { result: blockhex }); var getBlockHash = sinon.stub().callsArgWith(1, null, { result: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f' }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind.getRawBlock(0, function(err, buffer) { + dashd.getRawBlock(0, function(err, buffer) { if (err) { return done(err); } @@ -3886,128 +3886,128 @@ describe('Bitcoin Service', function() { describe('#getBlock', function() { var blockhex = '0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000'; it('will give an rpc error from client getblock', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, {code: -1, message: 'Test error'}); var getBlockHash = sinon.stub().callsArgWith(1, null, {}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind.getBlock(0, function(err) { + dashd.getBlock(0, function(err) { err.should.be.instanceof(Error); done(); }); }); it('will give an rpc error from client getblockhash', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind.getBlock(0, function(err) { + dashd.getBlock(0, function(err) { err.should.be.instanceof(Error); done(); }); }); - it('will getblock as bitcore object from height', function(done) { - var bitcoind = new BitcoinService(baseConfig); + it('will getblock as dashcore object from height', function(done) { + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, null, { result: blockhex }); var getBlockHash = sinon.stub().callsArgWith(1, null, { result: '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b' }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind.getBlock(0, function(err, block) { + dashd.getBlock(0, function(err, block) { should.not.exist(err); getBlock.args[0][0].should.equal('00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'); getBlock.args[0][1].should.equal(false); - block.should.be.instanceof(bitcore.Block); + block.should.be.instanceof(dashcore.Block); done(); }); }); - it('will getblock as bitcore object', function(done) { - var bitcoind = new BitcoinService(baseConfig); + it('will getblock as dashcore object', function(done) { + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, null, { result: blockhex }); var getBlockHash = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind.getBlock('00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b', function(err, block) { + dashd.getBlock('00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b', function(err, block) { should.not.exist(err); getBlockHash.callCount.should.equal(0); getBlock.callCount.should.equal(1); getBlock.args[0][0].should.equal('00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'); getBlock.args[0][1].should.equal(false); - block.should.be.instanceof(bitcore.Block); + block.should.be.instanceof(dashcore.Block); done(); }); }); it('will get block from cache', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, null, { result: blockhex }); var getBlockHash = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock, getBlockHash: getBlockHash } }); var hash = '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'; - bitcoind.getBlock(hash, function(err, block) { + dashd.getBlock(hash, function(err, block) { should.not.exist(err); getBlockHash.callCount.should.equal(0); getBlock.callCount.should.equal(1); - block.should.be.instanceof(bitcore.Block); - bitcoind.getBlock(hash, function(err, block) { + block.should.be.instanceof(dashcore.Block); + dashd.getBlock(hash, function(err, block) { should.not.exist(err); getBlockHash.callCount.should.equal(0); getBlock.callCount.should.equal(1); - block.should.be.instanceof(bitcore.Block); + block.should.be.instanceof(dashcore.Block); done(); }); }); }); it('will get block from cache with height (but not height)', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, null, { result: blockhex }); var getBlockHash = sinon.stub().callsArgWith(1, null, { result: '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b' }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock, getBlockHash: getBlockHash } }); - bitcoind.getBlock(0, function(err, block) { + dashd.getBlock(0, function(err, block) { should.not.exist(err); getBlockHash.callCount.should.equal(1); getBlock.callCount.should.equal(1); - block.should.be.instanceof(bitcore.Block); - bitcoind.getBlock(0, function(err, block) { + block.should.be.instanceof(dashcore.Block); + dashd.getBlock(0, function(err, block) { should.not.exist(err); getBlockHash.callCount.should.equal(2); getBlock.callCount.should.equal(1); - block.should.be.instanceof(bitcore.Block); + block.should.be.instanceof(dashcore.Block); done(); }); }); @@ -4016,32 +4016,32 @@ describe('Bitcoin Service', function() { describe('#getBlockHashesByTimestamp', function() { it('should give an rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHashes = sinon.stub().callsArgWith(2, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHashes: getBlockHashes } }); - bitcoind.getBlockHashesByTimestamp(1441911000, 1441914000, function(err, hashes) { + dashd.getBlockHashesByTimestamp(1441911000, 1441914000, function(err, hashes) { should.exist(err); err.message.should.equal('error'); done(); }); }); it('should get the correct block hashes', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var block1 = '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'; var block2 = '000000000383752a55a0b2891ce018fd0fdc0b6352502772b034ec282b4a1bf6'; var getBlockHashes = sinon.stub().callsArgWith(2, null, { result: [block2, block1] }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHashes: getBlockHashes } }); - bitcoind.getBlockHashesByTimestamp(1441914000, 1441911000, function(err, hashes) { + dashd.getBlockHashesByTimestamp(1441914000, 1441911000, function(err, hashes) { should.not.exist(err); hashes.should.deep.equal([block2, block1]); done(); @@ -4052,45 +4052,45 @@ describe('Bitcoin Service', function() { describe('#getBlockHeader', function() { var blockhash = '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'; it('will give error from getBlockHash', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind.getBlockHeader(10, function(err) { + dashd.getBlockHeader(10, function(err) { err.should.be.instanceof(Error); }); }); it('it will give rpc error from client getblockheader', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHeader = sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader } }); - bitcoind.getBlockHeader(blockhash, function(err) { + dashd.getBlockHeader(blockhash, function(err) { err.should.be.instanceof(Error); }); }); it('it will give rpc error from client getblockhash', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHeader = sinon.stub(); var getBlockHash = sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader, getBlockHash: getBlockHash } }); - bitcoind.getBlockHeader(0, function(err) { + dashd.getBlockHeader(0, function(err) { err.should.be.instanceof(Error); }); }); it('will give result from client getblockheader (from height)', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { hash: '0000000000000a817cd3a74aec2f2246b59eb2cbb1ad730213e6c4a1d68ec2f6', version: 536870912, @@ -4126,20 +4126,20 @@ describe('Bitcoin Service', function() { var getBlockHash = sinon.stub().callsArgWith(1, null, { result: blockhash }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader, getBlockHash: getBlockHash } }); - bitcoind.getBlockHeader(0, function(err, blockHeader) { + dashd.getBlockHeader(0, function(err, blockHeader) { should.not.exist(err); getBlockHeader.args[0][0].should.equal(blockhash); blockHeader.should.deep.equal(result); }); }); it('will give result from client getblockheader (from hash)', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { hash: '0000000000000a817cd3a74aec2f2246b59eb2cbb1ad730213e6c4a1d68ec2f6', version: 536870912, @@ -4173,13 +4173,13 @@ describe('Bitcoin Service', function() { } }); var getBlockHash = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader, getBlockHash: getBlockHash } }); - bitcoind.getBlockHeader(blockhash, function(err, blockHeader) { + dashd.getBlockHeader(blockhash, function(err, blockHeader) { should.not.exist(err); getBlockHash.callCount.should.equal(0); blockHeader.should.deep.equal(result); @@ -4190,31 +4190,31 @@ describe('Bitcoin Service', function() { describe('#getBlockHeaders', function(){ var blockhash = '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'; it('will gave error from getBlockHash', function(){ - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind.getBlockHeaders(10, function(err) { + dashd.getBlockHeaders(10, function(err) { err.should.be.instanceof(Error); }); }); it('it will give rpc error from client getblockheaders', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHeader = sinon.stub().callsArgWith(1, {code: -1, message: 'Test error'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader } }); - bitcoind.getBlockHeaders(blockhash, function(err){ + dashd.getBlockHeaders(blockhash, function(err){ err.should.be.instanceof(Error); }); }); it("will get an array of block headers", function(){ - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var result = { hash: '0000000000000a817cd3a74aec2f2246b59eb2cbb1ad730213e6c4a1d68ec2f6', @@ -4289,20 +4289,20 @@ describe('Bitcoin Service', function() { var getBlockHash2 = sinon.stub().callsArgWith(1, null, { result: "00000000000012093f65b9fdba40c4131270a90158864ea422f0ab6acc12ec08" }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader, getBlockHash: getBlockHash } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHeader: getBlockHeader2, getBlockHash: getBlockHash2 } }); - bitcoind.getBlockHeaders(_blockHash, function(err, blockHeader){ + dashd.getBlockHeaders(_blockHash, function(err, blockHeader){ should.not.exist(err); blockHeader[0].hash.should.equal(_blockHash); // getBlockHeader.args[0][0].should.equal(blockhash); @@ -4313,14 +4313,14 @@ describe('Bitcoin Service', function() { describe('#_maybeGetBlockHash', function() { it('will not get block hash with an address', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind._maybeGetBlockHash('8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi', function(err, hash) { + dashd._maybeGetBlockHash('8oUSpiq5REeEKAzS1qSXoJbZ9TRfH1L6mi', function(err, hash) { if (err) { return done(err); } @@ -4330,14 +4330,14 @@ describe('Bitcoin Service', function() { }); }); it('will not get block hash with non zero-nine numeric string', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub(); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind._maybeGetBlockHash('109a', function(err, hash) { + dashd._maybeGetBlockHash('109a', function(err, hash) { if (err) { return done(err); } @@ -4347,16 +4347,16 @@ describe('Bitcoin Service', function() { }); }); it('will get the block hash if argument is a number', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, null, { result: 'blockhash' }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind._maybeGetBlockHash(10, function(err, hash) { + dashd._maybeGetBlockHash(10, function(err, hash) { if (err) { return done(err); } @@ -4366,16 +4366,16 @@ describe('Bitcoin Service', function() { }); }); it('will get the block hash if argument is a number (as string)', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, null, { result: 'blockhash' }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind._maybeGetBlockHash('10', function(err, hash) { + dashd._maybeGetBlockHash('10', function(err, hash) { if (err) { return done(err); } @@ -4385,23 +4385,23 @@ describe('Bitcoin Service', function() { }); }); it('will try multiple nodes if one fails', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, null, { result: 'blockhash' }); getBlockHash.onCall(0).callsArgWith(1, {code: -1, message: 'test'}); - bitcoind.tryAllInterval = 1; - bitcoind.nodes.push({ + dashd.tryAllInterval = 1; + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind._maybeGetBlockHash(10, function(err, hash) { + dashd._maybeGetBlockHash(10, function(err, hash) { if (err) { return done(err); } @@ -4411,20 +4411,20 @@ describe('Bitcoin Service', function() { }); }); it('will give error from getBlockHash', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlockHash = sinon.stub().callsArgWith(1, {code: -1, message: 'test'}); - bitcoind.tryAllInterval = 1; - bitcoind.nodes.push({ + dashd.tryAllInterval = 1; + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlockHash: getBlockHash } }); - bitcoind._maybeGetBlockHash(10, function(err, hash) { + dashd._maybeGetBlockHash(10, function(err, hash) { getBlockHash.callCount.should.equal(2); err.should.be.instanceOf(Error); err.message.should.equal('test'); @@ -4437,29 +4437,29 @@ describe('Bitcoin Service', function() { describe('#getBlockOverview', function() { var blockhash = '00000000050a6d07f583beba2d803296eb1e9d4980c4a20f206c584e89a4f02b'; it('will handle error from maybeGetBlockHash', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind._maybeGetBlockHash = sinon.stub().callsArgWith(1, new Error('test')); - bitcoind.getBlockOverview(blockhash, function(err) { + var dashd = new DashService(baseConfig); + dashd._maybeGetBlockHash = sinon.stub().callsArgWith(1, new Error('test')); + dashd.getBlockOverview(blockhash, function(err) { err.should.be.instanceOf(Error); done(); }); }); it('will give error from client.getBlock', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBlock = sinon.stub().callsArgWith(2, {code: -1, message: 'test'}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock } }); - bitcoind.getBlockOverview(blockhash, function(err) { + dashd.getBlockOverview(blockhash, function(err) { err.should.be.instanceOf(Error); err.message.should.equal('test'); done(); }); }); it('will give expected result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var blockResult = { hash: blockhash, version: 536870912, @@ -4478,7 +4478,7 @@ describe('Bitcoin Service', function() { var getBlock = sinon.stub().callsArgWith(2, null, { result: blockResult }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBlock: getBlock } @@ -4498,12 +4498,12 @@ describe('Bitcoin Service', function() { blockOverview.bits.should.equal('1a13ca10'); blockOverview.difficulty.should.equal(847779.0710240941); } - bitcoind.getBlockOverview(blockhash, function(err, blockOverview) { + dashd.getBlockOverview(blockhash, function(err, blockOverview) { if (err) { return done(err); } checkBlock(blockOverview); - bitcoind.getBlockOverview(blockhash, function(err, blockOverview) { + dashd.getBlockOverview(blockhash, function(err, blockOverview) { checkBlock(blockOverview); getBlock.callCount.should.equal(1); done(); @@ -4514,30 +4514,30 @@ describe('Bitcoin Service', function() { describe('#estimateFee', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var estimateFee = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { estimateFee: estimateFee } }); - bitcoind.estimateFee(1, function(err) { + dashd.estimateFee(1, function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will call client estimateFee and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var estimateFee = sinon.stub().callsArgWith(1, null, { result: -1 }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { estimateFee: estimateFee } }); - bitcoind.estimateFee(1, function(err, feesPerKb) { + dashd.estimateFee(1, function(err, feesPerKb) { if (err) { return done(err); } @@ -4548,31 +4548,31 @@ describe('Bitcoin Service', function() { }); describe('#sendTransaction', function(done) { - var tx = bitcore.Transaction(txhex); + var tx = dashcore.Transaction(txhex); it('will give rpc error', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var sendRawTransaction = sinon.stub().callsArgWith(3, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { sendRawTransaction: sendRawTransaction } }); - bitcoind.sendTransaction(txhex, function(err) { + dashd.sendTransaction(txhex, function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); }); }); it('will send to client and get hash', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var sendRawTransaction = sinon.stub().callsArgWith(3, null, { result: tx.hash }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { sendRawTransaction: sendRawTransaction } }); - bitcoind.sendTransaction(txhex, function(err, hash) { + dashd.sendTransaction(txhex, function(err, hash) { if (err) { return done(err); } @@ -4580,16 +4580,16 @@ describe('Bitcoin Service', function() { }); }); it('will send to client with absurd fees and get hash', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var sendRawTransaction = sinon.stub().callsArgWith(3, null, { result: tx.hash }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { sendRawTransaction: sendRawTransaction } }); - bitcoind.sendTransaction(txhex, {allowAbsurdFees: true}, function(err, hash) { + dashd.sendTransaction(txhex, {allowAbsurdFees: true}, function(err, hash) { if (err) { return done(err); } @@ -4597,60 +4597,60 @@ describe('Bitcoin Service', function() { }); }); it('missing callback will throw error', function() { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var sendRawTransaction = sinon.stub().callsArgWith(3, null, { result: tx.hash }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { sendRawTransaction: sendRawTransaction } }); - var transaction = bitcore.Transaction(); + var transaction = dashcore.Transaction(); (function() { - bitcoind.sendTransaction(transaction); + dashd.sendTransaction(transaction); }).should.throw(Error); }); }); describe('#getRawTransaction', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getRawTransaction = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } }); - bitcoind.getRawTransaction('txid', function(err) { + dashd.getRawTransaction('txid', function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will try all nodes', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.tryAllInterval = 1; + var dashd = new DashService(baseConfig); + dashd.tryAllInterval = 1; var getRawTransactionWithError = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); var getRawTransaction = sinon.stub().callsArgWith(1, null, { result: txhex }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransactionWithError } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransactionWithError } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } }); - bitcoind.getRawTransaction('txid', function(err, tx) { + dashd.getRawTransaction('txid', function(err, tx) { if (err) { return done(err); } @@ -4660,23 +4660,23 @@ describe('Bitcoin Service', function() { }); }); it('will get from cache', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getRawTransaction = sinon.stub().callsArgWith(1, null, { result: txhex }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } }); - bitcoind.getRawTransaction('txid', function(err, tx) { + dashd.getRawTransaction('txid', function(err, tx) { if (err) { return done(err); } should.exist(tx); tx.should.be.an.instanceof(Buffer); - bitcoind.getRawTransaction('txid', function(err, tx) { + dashd.getRawTransaction('txid', function(err, tx) { should.exist(tx); tx.should.be.an.instanceof(Buffer); getRawTransaction.callCount.should.equal(1); @@ -4688,70 +4688,70 @@ describe('Bitcoin Service', function() { describe('#getTransaction', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getRawTransaction = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } }); - bitcoind.getTransaction('txid', function(err) { + dashd.getTransaction('txid', function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will try all nodes', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.tryAllInterval = 1; + var dashd = new DashService(baseConfig); + dashd.tryAllInterval = 1; var getRawTransactionWithError = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); var getRawTransaction = sinon.stub().callsArgWith(1, null, { result: txhex }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransactionWithError } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransactionWithError } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } }); - bitcoind.getTransaction('txid', function(err, tx) { + dashd.getTransaction('txid', function(err, tx) { if (err) { return done(err); } should.exist(tx); - tx.should.be.an.instanceof(bitcore.Transaction); + tx.should.be.an.instanceof(dashcore.Transaction); done(); }); }); it('will get from cache', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getRawTransaction = sinon.stub().callsArgWith(1, null, { result: txhex }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } }); - bitcoind.getTransaction('txid', function(err, tx) { + dashd.getTransaction('txid', function(err, tx) { if (err) { return done(err); } should.exist(tx); - tx.should.be.an.instanceof(bitcore.Transaction); + tx.should.be.an.instanceof(dashcore.Transaction); - bitcoind.getTransaction('txid', function(err, tx) { + dashd.getTransaction('txid', function(err, tx) { should.exist(tx); - tx.should.be.an.instanceof(bitcore.Transaction); + tx.should.be.an.instanceof(dashcore.Transaction); getRawTransaction.callCount.should.equal(1); done(); }); @@ -4803,25 +4803,25 @@ describe('Bitcoin Service', function() { ] }; it('should give a transaction with height and timestamp', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, {code: -1, message: 'Test error'}) } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err) { + dashd.getDetailedTransaction(txid, function(err) { should.exist(err); err.should.be.instanceof(errors.RPCError); done(); }); }); it('should give a transaction with all properties', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getRawTransaction = sinon.stub().callsArgWith(2, null, { result: rpcRawTransaction }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: getRawTransaction } @@ -4858,12 +4858,12 @@ describe('Bitcoin Service', function() { should.equal(output.spentIndex, 2); should.equal(output.spentHeight, 100); } - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { if (err) { return done(err); } checkTx(tx); - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { if (err) { return done(err); } @@ -4874,7 +4874,7 @@ describe('Bitcoin Service', function() { }); }); it('should set coinbase to true', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var rawTransaction = JSON.parse((JSON.stringify(rpcRawTransaction))); delete rawTransaction.vin[0]; rawTransaction.vin = [ @@ -4882,7 +4882,7 @@ describe('Bitcoin Service', function() { coinbase: 'abcdef' } ]; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, null, { result: rawTransaction @@ -4890,17 +4890,17 @@ describe('Bitcoin Service', function() { } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { should.exist(tx); should.equal(tx.coinbase, true); done(); }); }); it('will not include address if address length is zero', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var rawTransaction = JSON.parse((JSON.stringify(rpcRawTransaction))); rawTransaction.vout[0].scriptPubKey.addresses = []; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, null, { result: rawTransaction @@ -4908,17 +4908,17 @@ describe('Bitcoin Service', function() { } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { should.exist(tx); should.equal(tx.outputs[0].address, null); done(); }); }); it('will not include address if address length is greater than 1', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var rawTransaction = JSON.parse((JSON.stringify(rpcRawTransaction))); rawTransaction.vout[0].scriptPubKey.addresses = ['one', 'two']; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, null, { result: rawTransaction @@ -4926,17 +4926,17 @@ describe('Bitcoin Service', function() { } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { should.exist(tx); should.equal(tx.outputs[0].address, null); done(); }); }); it('will handle scriptPubKey.addresses not being set', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var rawTransaction = JSON.parse((JSON.stringify(rpcRawTransaction))); delete rawTransaction.vout[0].scriptPubKey['addresses']; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, null, { result: rawTransaction @@ -4944,18 +4944,18 @@ describe('Bitcoin Service', function() { } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { should.exist(tx); should.equal(tx.outputs[0].address, null); done(); }); }); it('will not include script if input missing scriptSig or coinbase', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var rawTransaction = JSON.parse((JSON.stringify(rpcRawTransaction))); delete rawTransaction.vin[0].scriptSig; delete rawTransaction.vin[0].coinbase; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, null, { result: rawTransaction @@ -4963,17 +4963,17 @@ describe('Bitcoin Service', function() { } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { should.exist(tx); should.equal(tx.inputs[0].script, null); done(); }); }); it('will set height to -1 if missing height', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var rawTransaction = JSON.parse((JSON.stringify(rpcRawTransaction))); delete rawTransaction.height; - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getRawTransaction: sinon.stub().callsArgWith(2, null, { result: rawTransaction @@ -4981,7 +4981,7 @@ describe('Bitcoin Service', function() { } }); var txid = '2d950d00494caf6bfc5fff2a3f839f0eb50f663ae85ce092bc5f9d45296ae91f'; - bitcoind.getDetailedTransaction(txid, function(err, tx) { + dashd.getDetailedTransaction(txid, function(err, tx) { should.exist(tx); should.equal(tx.height, -1); done(); @@ -4991,30 +4991,30 @@ describe('Bitcoin Service', function() { describe('#getBestBlockHash', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBestBlockHash: getBestBlockHash } }); - bitcoind.getBestBlockHash(function(err) { + dashd.getBestBlockHash(function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will call client getInfo and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getBestBlockHash = sinon.stub().callsArgWith(0, null, { result: 'besthash' }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getBestBlockHash: getBestBlockHash } }); - bitcoind.getBestBlockHash(function(err, hash) { + dashd.getBestBlockHash(function(err, hash) { if (err) { return done(err); } @@ -5027,35 +5027,35 @@ describe('Bitcoin Service', function() { describe('#getSpentInfo', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getSpentInfo = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getSpentInfo: getSpentInfo } }); - bitcoind.getSpentInfo({}, function(err) { + dashd.getSpentInfo({}, function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will empty object when not found', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getSpentInfo = sinon.stub().callsArgWith(1, {message: 'test', code: -5}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getSpentInfo: getSpentInfo } }); - bitcoind.getSpentInfo({}, function(err, info) { + dashd.getSpentInfo({}, function(err, info) { should.not.exist(err); info.should.deep.equal({}); done(); }); }); it('will call client getSpentInfo and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getSpentInfo = sinon.stub().callsArgWith(1, null, { result: { txid: 'txid', @@ -5063,12 +5063,12 @@ describe('Bitcoin Service', function() { height: 101 } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getSpentInfo: getSpentInfo } }); - bitcoind.getSpentInfo({}, function(err, info) { + dashd.getSpentInfo({}, function(err, info) { if (err) { return done(err); } @@ -5082,22 +5082,22 @@ describe('Bitcoin Service', function() { describe('#getInfo', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var getInfo = sinon.stub().callsArgWith(0, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: getInfo } }); - bitcoind.getInfo(function(err) { + dashd.getInfo(function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will call client getInfo and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.node.getNetworkName = sinon.stub().returns('testnet'); + var dashd = new DashService(baseConfig); + dashd.node.getNetworkName = sinon.stub().returns('testnet'); var getInfo = sinon.stub().callsArgWith(0, null, { result: { version: 1, @@ -5112,12 +5112,12 @@ describe('Bitcoin Service', function() { errors: '' } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { getInfo: getInfo } }); - bitcoind.getInfo(function(err, info) { + dashd.getInfo(function(err, info) { if (err) { return done(err); } @@ -5140,7 +5140,7 @@ describe('Bitcoin Service', function() { describe('#govObject', function() { it('will call client gobject list and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var gobject = sinon.stub().callsArgWith(1, null, { result: [{ "Hash": "9ce5609d41b88fca51dd3f4ad098467cf8c6f2c1b2adf93a6862a7b9bdf01a00", @@ -5192,12 +5192,12 @@ describe('Bitcoin Service', function() { "AbstainCount": 0 }] }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { gobject: gobject } }); - bitcoind.govObjectList({type: 1}, function(err, result) { + dashd.govObjectList({type: 1}, function(err, result) { if (err) { return done(err); } @@ -5208,14 +5208,14 @@ describe('Bitcoin Service', function() { }); it('will call client gobject list and return error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var gobject = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { gobject: gobject } }); - bitcoind.govObjectList({type: 1}, function(err, result) { + dashd.govObjectList({type: 1}, function(err, result) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); @@ -5223,7 +5223,7 @@ describe('Bitcoin Service', function() { }); it('will call client gobject get and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var hash = "4ef24027c631c43035aa4cf5c672e1298311decd9cffbd16731f454c9c0d6d00"; var gobject = sinon.stub().callsArgWith(2, null, { result: { @@ -5264,12 +5264,12 @@ describe('Bitcoin Service', function() { "fCachedEndorsed": false } }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { gobject: gobject } }); - bitcoind.govObjectHash('4ef24027c631c43035aa4cf5c672e1298311decd9cffbd16731f454c9c0d6d00', function(err, result) { + dashd.govObjectHash('4ef24027c631c43035aa4cf5c672e1298311decd9cffbd16731f454c9c0d6d00', function(err, result) { if (err) { return done(err); } @@ -5288,14 +5288,14 @@ describe('Bitcoin Service', function() { }); it('will call client gobject get and return error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var gobject = sinon.stub().callsArgWith(2, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { gobject: gobject } }); - bitcoind.govObjectHash('4ef24027c631c43035aa4cf5c672e1298311decd9cffbd16731f454c9c0d6d00', function(err, result) { + dashd.govObjectHash('4ef24027c631c43035aa4cf5c672e1298311decd9cffbd16731f454c9c0d6d00', function(err, result) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); @@ -5305,9 +5305,9 @@ describe('Bitcoin Service', function() { }); describe('#sporksList', function(){ it('will call client sporks and give result', function(done){ - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { spork: function(param, callback){ if(param==="show"){ @@ -5327,7 +5327,7 @@ describe('Bitcoin Service', function() { } } }); - bitcoind.getSpork(function(err, SporkList) { + dashd.getSpork(function(err, SporkList) { if (err) { return done(err); } @@ -5349,9 +5349,9 @@ describe('Bitcoin Service', function() { }); describe('#getMNList', function(){ it('will call client masternode list and give result', function(done){ - var bitcoind = new BitcoinService(baseConfig); - bitcoind.isSynced = function(callback) { return callback(null, true) }; - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.isSynced = function(callback) { return callback(null, true) }; + dashd.nodes.push({ client: { masternodelist: function(type, cb){ switch (type){ @@ -5396,7 +5396,7 @@ describe('Bitcoin Service', function() { } }); - bitcoind.getMNList(function(err, MNList) { + dashd.getMNList(function(err, MNList) { if (err) { return done(err); } @@ -5415,9 +5415,9 @@ describe('Bitcoin Service', function() { }); it('will return error if one of nodes not synced yet', function(done){ - var bitcoind = new BitcoinService(baseConfig); - bitcoind.isSynced = function(callback) { return callback(null, false) }; - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.isSynced = function(callback) { return callback(null, false) }; + dashd.nodes.push({ client: { masternodelist: function(type, cb){ switch (type){ @@ -5462,7 +5462,7 @@ describe('Bitcoin Service', function() { } }); - bitcoind.getMNList(function(err, MNList) { + dashd.getMNList(function(err, MNList) { err.should.be.instanceof(Error); console.log(err); done(); @@ -5470,9 +5470,9 @@ describe('Bitcoin Service', function() { }); it('will return error if checking synced state of nodes failed', function(done){ - var bitcoind = new BitcoinService(baseConfig); - bitcoind.isSynced = function(callback) { return callback(new Error('Failed')) }; - bitcoind.nodes.push({ + var dashd = new DashService(baseConfig); + dashd.isSynced = function(callback) { return callback(new Error('Failed')) }; + dashd.nodes.push({ client: { masternodelist: function(type, cb){ switch (type){ @@ -5517,7 +5517,7 @@ describe('Bitcoin Service', function() { } }); - bitcoind.getMNList(function(err, MNList) { + dashd.getMNList(function(err, MNList) { err.should.be.instanceof(Error); done(); }); @@ -5526,30 +5526,30 @@ describe('Bitcoin Service', function() { describe('#generateBlock', function() { it('will give rpc error', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var generate = sinon.stub().callsArgWith(1, {message: 'error', code: -1}); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { generate: generate } }); - bitcoind.generateBlock(10, function(err) { + dashd.generateBlock(10, function(err) { should.exist(err); err.should.be.an.instanceof(errors.RPCError); done(); }); }); it('will call client generate and give result', function(done) { - var bitcoind = new BitcoinService(baseConfig); + var dashd = new DashService(baseConfig); var generate = sinon.stub().callsArgWith(1, null, { result: ['hash'] }); - bitcoind.nodes.push({ + dashd.nodes.push({ client: { generate: generate } }); - bitcoind.generateBlock(10, function(err, hashes) { + dashd.generateBlock(10, function(err, hashes) { if (err) { return done(err); } @@ -5562,45 +5562,45 @@ describe('Bitcoin Service', function() { describe('#stop', function() { it('will callback if spawn is not set', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.stop(done); + var dashd = new DashService(baseConfig); + dashd.stop(done); }); it('will exit spawned process', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.spawn = {}; - bitcoind.spawn.process = new EventEmitter(); - bitcoind.spawn.process.kill = sinon.stub(); - bitcoind.stop(done); - bitcoind.spawn.process.kill.callCount.should.equal(1); - bitcoind.spawn.process.kill.args[0][0].should.equal('SIGINT'); - bitcoind.spawn.process.emit('exit', 0); + var dashd = new DashService(baseConfig); + dashd.spawn = {}; + dashd.spawn.process = new EventEmitter(); + dashd.spawn.process.kill = sinon.stub(); + dashd.stop(done); + dashd.spawn.process.kill.callCount.should.equal(1); + dashd.spawn.process.kill.args[0][0].should.equal('SIGINT'); + dashd.spawn.process.emit('exit', 0); }); it('will give error with non-zero exit status code', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.spawn = {}; - bitcoind.spawn.process = new EventEmitter(); - bitcoind.spawn.process.kill = sinon.stub(); - bitcoind.stop(function(err) { + var dashd = new DashService(baseConfig); + dashd.spawn = {}; + dashd.spawn.process = new EventEmitter(); + dashd.spawn.process.kill = sinon.stub(); + dashd.stop(function(err) { err.should.be.instanceof(Error); err.code.should.equal(1); done(); }); - bitcoind.spawn.process.kill.callCount.should.equal(1); - bitcoind.spawn.process.kill.args[0][0].should.equal('SIGINT'); - bitcoind.spawn.process.emit('exit', 1); + dashd.spawn.process.kill.callCount.should.equal(1); + dashd.spawn.process.kill.args[0][0].should.equal('SIGINT'); + dashd.spawn.process.emit('exit', 1); }); it('will stop after timeout', function(done) { - var bitcoind = new BitcoinService(baseConfig); - bitcoind.shutdownTimeout = 300; - bitcoind.spawn = {}; - bitcoind.spawn.process = new EventEmitter(); - bitcoind.spawn.process.kill = sinon.stub(); - bitcoind.stop(function(err) { + var dashd = new DashService(baseConfig); + dashd.shutdownTimeout = 300; + dashd.spawn = {}; + dashd.spawn.process = new EventEmitter(); + dashd.spawn.process.kill = sinon.stub(); + dashd.stop(function(err) { err.should.be.instanceof(Error); done(); }); - bitcoind.spawn.process.kill.callCount.should.equal(1); - bitcoind.spawn.process.kill.args[0][0].should.equal('SIGINT'); + dashd.spawn.process.kill.callCount.should.equal(1); + dashd.spawn.process.kill.args[0][0].should.equal('SIGINT'); }); });